Interface IUserStatsService
Namespace: IdleKit.Gameplay.Segmentation
Assembly: cs.temp.dll.dll
Syntax
public interface IUserStatsService : IService
Properties
UserId
Returns a user ID assigned to the current user by the segmentation provider.
Declaration
string UserId { get; }
Property Value
Type | Description |
---|---|
String |
Methods
GetStats(UserStatsAccessModifier, Action<Dictionary<String, String>>)
Starts a process of retrieving current user's stats for the specified domain and access modifier, and then calls a callback actions with the results.
Declaration
void GetStats(UserStatsAccessModifier accessModifier, Action<Dictionary<string, string>> onStatsReceived)
Parameters
Type | Name | Description |
---|---|---|
UserStatsAccessModifier | accessModifier | Determines the access modifier of the data to retrieve. "UserStatsAccessModifier.Public" would mean other players can see these stats. "UserStatsAccessModifier.Private" would mean this stat would only be visible to the player themself. |
Action<Dictionary<String, String>> | onStatsReceived | Callback for when the data has been retrieved. |
GetStats(Int64, UserStatsAccessModifier, Action<Dictionary<String, String>>)
Starts a process of retrieving the passed in user's stats for the specified domain and access modifier, and then calls a callback actions with the results.
Declaration
void GetStats(long userId, UserStatsAccessModifier accessModifier, Action<Dictionary<string, string>> onStatsReceived)
Parameters
Type | Name | Description |
---|---|---|
Int64 | userId | User id for the user whose stats we're retrieving. |
UserStatsAccessModifier | accessModifier | Determines the access modifier of the data to retrieve. "UserStatsAccessModifier.Public" would mean other players can see these stats. "UserStatsAccessModifier.Private" would mean this stat would only be visible to the player themself. |
Action<Dictionary<String, String>> | onStatsReceived | Callback for when the data has been retrieved. |
GetStatsAsync(String, Action<Dictionary<String, String>>, Nullable<Int64>)
An async version of the
Declaration
Task<Dictionary<string, string>> GetStatsAsync(string accessModifier, Action<Dictionary<string, string>> onStatsReceived, long? userId = default(long? ))
Parameters
Type | Name | Description |
---|---|---|
String | accessModifier | |
Action<Dictionary<String, String>> | onStatsReceived | |
Nullable<Int64> | userId |
Returns
Type | Description |
---|---|
Task<Dictionary<String, String>> |
SetStats(Dictionary<String, String>, Action)
Set stats without the access modifier
Declaration
void SetStats(Dictionary<string, string> stats, Action onStatsSet)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<String, String> | stats | The dictionary which holds the stats keys and their values as strings. |
Action | onStatsSet | Callback for when the data has finished applying. |
SetStats(UserStatsAccessModifier, Dictionary<String, String>, Action)
Used for changing the player stats, which can be used for analytics/segmentation.
Declaration
void SetStats(UserStatsAccessModifier accessModifier, Dictionary<string, string> stats, Action onStatsSet)
Parameters
Type | Name | Description |
---|---|---|
UserStatsAccessModifier | accessModifier | Whether this stat should be visible to everyone ("public"), or it is only visible to the player ("private") |
Dictionary<String, String> | stats | The dictionary which holds the stats keys and their values as strings. |
Action | onStatsSet | Callback for when the data has finished applying. |