Beamable SDK
Public Member Functions | Protected Member Functions | List of all members
Beamable.Player.PlayerCurrencyGroup Class Reference

The PlayerCurrencyGroup is a readonly observable list of currencies for a player. It represents all currencies for a player. More...

Inheritance diagram for Beamable.Player.PlayerCurrencyGroup:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Player.PlayerCurrencyGroup:
Collaboration graph
[legend]

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]
 
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
 

Detailed Description

The PlayerCurrencyGroup is a readonly observable list of currencies for a player. It represents all currencies for a player.

Member Function Documentation

◆ Add()

Promise Beamable.Player.PlayerCurrencyGroup.Add ( CurrencyRef  currency,
long  amount 
)
inline

Update the currency's PlayerCurrency.Amount by the given amount. Internally, this will trigger an PlayerInventory.Update(Beamable.Common.Api.Inventory.InventoryUpdateBuilder,string)

Parameters
currencyThe currency to modify
amountThe amount the currency will change by. This is incremental. A negative number will decrement the currency.
Returns
A promise representing when the add operation has completed

◆ GetCurrency()

PlayerCurrency Beamable.Player.PlayerCurrencyGroup.GetCurrency ( CurrencyRef  id)
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.

Parameters
id
Returns

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