Interface ILeaderboardsService
Service intended for manipulating and retrieving data from player leaderboards.
Namespace: IdleKit.Gameplay
Assembly: cs.temp.dll.dll
Syntax
public interface ILeaderboardsService : IService
Properties
CurrencyDifferenceSinceLastChange
The score amount, which will be submitted to the leaderboard when it next sends an update to the server
Declaration
double CurrencyDifferenceSinceLastChange { get; }
Property Value
Type | Description |
---|---|
Double |
Methods
GetLeaderboard(String, Int32, Action<List<LeaderboardEntry>>, Int32, Nullable<Int64>, Nullable<Int64>)
Retrieves a leaderboard with the specific id.
Declaration
void GetLeaderboard(string leaderboardId, int maxEntryNumber, Action<List<LeaderboardEntry>> onLeaderboardRetrieved, int startEntryNumber = 0, long? focusUid = default(long? ), long? appendUid = default(long? ))
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId | |
Int32 | maxEntryNumber | |
Action<List<LeaderboardEntry>> | onLeaderboardRetrieved | |
Int32 | startEntryNumber | A leaderboard entry from which to start the resulting list. |
Nullable<Int64> | focusUid | |
Nullable<Int64> | appendUid |
GetLeaderboardUsername(String, Action<String>)
Retrieves the player's username in a specific leaderboard with the passed in id.
Declaration
void GetLeaderboardUsername(string leaderboardId, Action<string> onComplete)
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId | The leaderboard id for which to retrieve the player's name. |
Action<String> | onComplete |
GetUsernameKey(String)
Returns a custom username key for the passed in leaderboardId. This key should be used to retrieve the player's username in the particular leaderboard.
Declaration
string GetUsernameKey(string leaderboardId)
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId |
Returns
Type | Description |
---|---|
String |
IncrementLeaderboardScore(String, Double, Dictionary<String, Object>)
Increments the score for the current player in the provided leaderboard by the provided amount.
Declaration
void IncrementLeaderboardScore(string leaderboardId, double incrementAmount, Dictionary<string, object> optionalParameters = null)
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId | |
Double | incrementAmount | |
Dictionary<String, Object> | optionalParameters |
SetLeaderboardScore(String, Double, Dictionary<String, Object>)
Sets a score for the current player in the provided leaderboard to the provided amount.
Declaration
void SetLeaderboardScore(string leaderboardId, double score, Dictionary<string, object> optionalParameters = null)
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId | |
Double | score | |
Dictionary<String, Object> | optionalParameters |
SetLeaderboardUsername(String, String, Action<String>)
Sets the username the current player has selected for the provided leaderboard id
Declaration
void SetLeaderboardUsername(string leaderboardId, string username, Action<string> onUsernameSet = null)
Parameters
Type | Name | Description |
---|---|---|
String | leaderboardId | The leaderboard id. Must be used in the |
String | username | Username selected |
Action<String> | onUsernameSet | A callback that gets called when the username was successfully retrieved or failed to retrieve. It contains the error message if the processing of settings the username did not succeed. |