Beamable SDK
|
The PlayerCurrencyGroup is a readonly observable list of currencies for a player. It represents all currencies for a player. More...
Public Member Functions | |
PlayerCurrencyGroup (IPlatformService platformService, InventoryService inventoryApi, INotificationService notificationService, ISdkEventService sdkEventService, IConnectivityService connectivityService, IDependencyProvider provider) | |
PlayerCurrency | GetCurrency (CurrencyRef id) |
Get a specific currency. If the currency doesn't yet exist, it will be returned as a new currency with a value of 0. More... | |
Promise | Add (CurrencyRef currency, long amount) |
Update the currency's PlayerCurrency.Amount by the given amount. Internally, this will trigger an PlayerInventory.Update(Beamable.Common.Api.Inventory.InventoryUpdateBuilder,string) More... | |
Public Member Functions inherited from Beamable.Common.Player.AbsObservableReadonlyList< PlayerCurrency > | |
IEnumerator< T > | GetEnumerator () |
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.AbsObservableReadonlyList< PlayerCurrency > | |
void | SetData (List< T > nextData) |
Additional Inherited Members | |
Properties inherited from Beamable.Common.Player.AbsObservableReadonlyList< PlayerCurrency > | |
int | Count [get] |
T | this[int index] [get] |
bool | IsInitialized [getprotected set] |
Events inherited from Beamable.Common.Player.AbsObservableReadonlyList< PlayerCurrency > | |
Action< List< T > > | OnDataUpdated |
An event that happens right after IObservable.OnUpdated, but this one contains the list of internal data. | |
Action< IEnumerable< T > > | OnElementsAdded |
An event that happens when new items are added to the list from a AbsRefreshableObservable.Refresh call. This event happens after the IObservable.OnUpdated event | |
Action< IEnumerable< T > > | OnElementRemoved |
An event that happens when new items are removed to the list from a AbsRefreshableObservable.Refresh call. This event happens after the IObservable.OnUpdated event | |
The PlayerCurrencyGroup is a readonly observable list of currencies for a player. It represents all currencies for a player.
|
inline |
Update the currency's PlayerCurrency.Amount by the given amount. Internally, this will trigger an PlayerInventory.Update(Beamable.Common.Api.Inventory.InventoryUpdateBuilder,string)
currency | The currency to modify |
amount | The amount the currency will change by. This is incremental. A negative number will decrement the currency. |
|
inline |
Get a specific currency. If the currency doesn't yet exist, it will be returned as a new currency with a value of 0.
id |