Interface IEventLeaderboardsService
Responsible for retrieving and setting information for leaderboards automatically generated for each active EventSettings.
Namespace: IdleKit.Gameplay
Assembly: cs.temp.dll.dll
Syntax
public interface IEventLeaderboardsService : IService
Methods
ClaimRankRewards(String)
Asynchronously rewards the player rewards based on their rank. Fires the ClaimEventRankRewardsStateAction when completed.
Declaration
void ClaimRankRewards(string eventSettingsId)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | IdleKit Id of the current event. |
GetCurrentEventLeaderboardScore(Int32, Action<List<LeaderboardEntry>>, Int32, Nullable<Int64>, Nullable<Int64>)
Retrieves a list of LeaderboardEntry in with the provided parameters for the event which is the player is currently in.
Declaration
void GetCurrentEventLeaderboardScore(int maxLeaderboardEntries, Action<List<LeaderboardEntry>> onLeaderboardRetrieved, int startEntryNumber = 0, long? focusUid = default(long? ), long? appendUid = default(long? ))
Parameters
Type | Name | Description |
---|---|---|
Int32 | maxLeaderboardEntries | Maximum amount of leaderboard entries to retrieve in this call. |
Action<List<LeaderboardEntry>> | onLeaderboardRetrieved | Callback which is executed when the request has finished successfully or otherwise. |
Int32 | startEntryNumber | A leaderboard entry from which to start the resulting list. |
Nullable<Int64> | focusUid | The user id which the resulting list of entries will be focused around. |
Nullable<Int64> | appendUid | Additional user id which will be appended to the resulting list of entries. |
GetEventLeaderboardId(String, Action<String>)
Declaration
void GetEventLeaderboardId(string eventSettingsId, Action<string> onLeaderboardIdRetrieved)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | |
Action<String> | onLeaderboardIdRetrieved |
GetEventLeaderboardRankRewardIds(String, Action<String[]>)
Retrieves the rewardIds that should be granted to the player at the end of the event, based on their current rank in the event leaderboard.
Declaration
void GetEventLeaderboardRankRewardIds(string eventSettingsId, Action<string[]> rankRewardIds)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | IdleKit Id of the event whose leaderboard rank rewards we want. |
Action<String[]> | rankRewardIds | A list of IRewardData Ids to be granted to the current player based on their current rank. |
GetEventLeaderboardScore(String, Int32, Action<List<LeaderboardEntry>>, Int32, Nullable<Int64>, Nullable<Int64>)
Retrieves a list of LeaderboardEntry with the provided parameters.
Declaration
void GetEventLeaderboardScore(string eventSettingsId, int maxLeaderboardEntries, Action<List<LeaderboardEntry>> onLeaderboardRetrieved, int startEntryNumber = 0, long? focusUid = default(long? ), long? appendUid = default(long? ))
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | IdleKit Id of the event whose leaderboard needs to be updated. |
Int32 | maxLeaderboardEntries | Maximum amount of leaderboard entries to retrieve in this call. |
Action<List<LeaderboardEntry>> | onLeaderboardRetrieved | Callback which is executed when the request has finished successfully or otherwise. |
Int32 | startEntryNumber | A leaderboard entry from which to start the resulting list. |
Nullable<Int64> | focusUid | The user id which the resulting list of entries will be focused around. |
Nullable<Int64> | appendUid | Additional user id which will be appended to the resulting list of entries. |
GetRank(String, Action<Int64>)
Asynchronously retrieves current rank of the player within a specified event.
Declaration
void GetRank(string eventSettingsId, Action<long> onRankRetrieved)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | IdleKit Id of the event whose leaderboard rank we want. |
Action<Int64> | onRankRetrieved | Callback which is executed when the players rank has been retrieved. Returns -1 on error. |
SetCurrentEventLeaderboardScore(Double, Boolean, Dictionary<String, Object>)
Sets the passed in score amount as the player's leaderboard score for the event which the player is currently in.
Declaration
void SetCurrentEventLeaderboardScore(double score, bool increment, Dictionary<string, object> stats = null)
Parameters
Type | Name | Description |
---|---|---|
Double | score | The score to set for the player in the leaderboard. |
Boolean | increment | Whether the passed in score is going to replace the existing value, or add to it. |
Dictionary<String, Object> | stats | Optional parameters for this leaderboard entry. By default IdleKit adds a Double value with the key |
SetEventLeaderboardScore(String, Double, Boolean, Dictionary<String, Object>)
Set the passed in score amount as the player's leaderboard score for the event with the passed in eventSettingsId. By default the score should be equal to the amount of LeaderboardCurrencyId currency./>
Declaration
void SetEventLeaderboardScore(string eventSettingsId, double score, bool increment, Dictionary<string, object> stats = null)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | IdleKit Id of the event whose leaderboard needs to be updated. |
Double | score | The score to set for the player in the leaderboard. |
Boolean | increment | Whether the passed in score is going to replace the existing value, or add to it. |
Dictionary<String, Object> | stats | Optional parameters for this leaderboard entry. By default IdleKit adds a Double value with
the key |
TryGetExistingEventView(String, out EventView)
Attempts to retrieve an EventView for the passed in eventSettingsId. This data contains information about the event like its leaderboard id
Declaration
bool TryGetExistingEventView(string eventSettingsId, out EventView eventView)
Parameters
Type | Name | Description |
---|---|---|
String | eventSettingsId | |
EventView | eventView |
Returns
Type | Description |
---|---|
Boolean |