Beamable SDK
Public Member Functions | Protected Member Functions | List of all members
Beamable.Player.PlayerStats Class Reference
Inheritance diagram for Beamable.Player.PlayerStats:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Player.PlayerStats:
Collaboration graph
[legend]

Public Member Functions

 PlayerStats (IPlatformService platform, IUserContext userContext, StatsService statService, ISdkEventService eventService, CoroutineService coroutineService)
 
Promise Set (string key, string value)
 Set the value of a PlayerStat. If multiple calls to this method are issued per frame, all set operations will be baked into one network operation. More...
 
Promise OnDispose ()
 Used as a way to allow services attached to a IDependencyProvider to clean up their state when the IDependencyProviderScope.Dispose method is called More...
 
- Public Member Functions inherited from Beamable.Common.Player.AbsObservableReadonlyDictionary< PlayerStat, SerializableDictionaryStringToPlayerStat >
IEnumerator< KeyValuePair< string, TValue > > GetEnumerator ()
 
bool ContainsKey (string key)
 
bool TryGetValue (string key, out TValue value)
 
override int GetBroadcastChecksum ()
 The broadcast checksum is a concept for change-detection. More...
 

Protected Member Functions

override async Promise PerformRefresh ()
 
- Protected Member Functions inherited from Beamable.Common.Player.AbsObservableReadonlyDictionary< PlayerStat, SerializableDictionaryStringToPlayerStat >
void SetData (TDict nextData)
 

Additional Inherited Members

- Properties inherited from Beamable.Common.Player.AbsObservableReadonlyDictionary< PlayerStat, SerializableDictionaryStringToPlayerStat >
int Count [get]
 
TValue this[string key] [get]
 
IEnumerable< string > Keys [get]
 
IEnumerable< TValue > Values [get]
 
bool IsInitialized [getprotected set]
 
- Events inherited from Beamable.Common.Player.AbsObservableReadonlyDictionary< PlayerStat, SerializableDictionaryStringToPlayerStat >
Action< SerializableDictionaryStringToSomething< TValue > > OnDataUpdated
 An event that happens right after IObservable.OnUpdated, but this one contains the dictionary of internal data.
 

Member Function Documentation

◆ OnDispose()

Promise Beamable.Player.PlayerStats.OnDispose ( )
inline

Used as a way to allow services attached to a IDependencyProvider to clean up their state when the IDependencyProviderScope.Dispose method is called

Returns
A promise that represents when the service's clean up is complete. This promise will hang the entire disposal process of the IDependencyProviderScope

Implements Beamable.Common.Dependencies.IBeamableDisposable.

◆ Set()

Promise Beamable.Player.PlayerStats.Set ( string  key,
string  value 
)
inline

Set the value of a PlayerStat. If multiple calls to this method are issued per frame, all set operations will be baked into one network operation.

Parameters
keyThe stat key
valueThe desired stat value. This will override the existing value.
Returns
A Promise representing the work. The promise won't complete until the set is complete.

The documentation for this class was generated from the following file: