Beamable SDK
Classes | Public Member Functions | List of all members
Beamable.Common.Api.UserDataCache< T > Class Template Referenceabstract

A UserDataCache<T> is a utility class that stores some generic type per player gamertag. More...

Inheritance diagram for Beamable.Common.Api.UserDataCache< T >:
Inheritance graph
[legend]

Classes

class  UserDataCacheEntry
 

Public Member Functions

delegate UserDataCache< T > FactoryFunction (string name, long ttlMs, CacheResolver resolver, IDependencyProvider provider)
 A general purpose factory function that returns a new instance of the UserDataCache<T>.
 
delegate Promise< Dictionary< long, T > > CacheResolver (List< long > gamerTags)
 A UserDataCache<T> has a mapping from player gamertags to some generic type per player. This function takes a set of gamertags, and fetches the latest data for each.
 
abstract Promise< T > Get (long gamerTag)
 Get the given player's data. If the data does not exist in the cache yet, the CacheResolver function will be triggered to resolve the data. More...
 
abstract Promise< Dictionary< long, T > > GetBatch (List< long > gamerTags)
 Get multiple players' data. If the players do not have the data in the cache yet, the CacheResolver function will be triggered to resolve all the data. More...
 
abstract void Set (long gamerTag, T data)
 Manually set the player data More...
 
abstract void Remove (long gamerTag)
 Remove a player from the cache. The next time this player's data is requested, the CacheResolver will be used to get the latest data for the player More...
 

Detailed Description

A UserDataCache<T> is a utility class that stores some generic type per player gamertag.

Template Parameters
T

Member Function Documentation

◆ Get()

abstract Promise< T > Beamable.Common.Api.UserDataCache< T >.Get ( long  gamerTag)
pure virtual

Get the given player's data. If the data does not exist in the cache yet, the CacheResolver function will be triggered to resolve the data.

Parameters
gamerTagThe gamertag for the player to get data for.
Returns
A Promise<T> containing the player data.

Implemented in Beamable.Api.UnityUserDataCache< T >.

◆ GetBatch()

abstract Promise< Dictionary< long, T > > Beamable.Common.Api.UserDataCache< T >.GetBatch ( List< long >  gamerTags)
pure virtual

Get multiple players' data. If the players do not have the data in the cache yet, the CacheResolver function will be triggered to resolve all the data.

Parameters
gamerTagsA set of gamertags
Returns
A Promise<T> containing a dictionary from gamertag to player data

Implemented in Beamable.Api.UnityUserDataCache< T >.

◆ Remove()

abstract void Beamable.Common.Api.UserDataCache< T >.Remove ( long  gamerTag)
pure virtual

Remove a player from the cache. The next time this player's data is requested, the CacheResolver will be used to get the latest data for the player

Parameters
gamerTagThe gamertag of the player to remove from the cache

Implemented in Beamable.Api.UnityUserDataCache< T >.

◆ Set()

abstract void Beamable.Common.Api.UserDataCache< T >.Set ( long  gamerTag,
data 
)
pure virtual

Manually set the player data

Parameters
gamerTagThe gamertag of the player to set data for
dataThe player's new data, which will overwrite the old data.

Implemented in Beamable.Api.UnityUserDataCache< T >.


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