Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Api.Inventory.InventoryService Class Reference

This type defines the Client main entry point for the Inventory feature. More...

Inheritance diagram for Beamable.Api.Inventory.InventoryService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.Inventory.InventoryService:
Collaboration graph
[legend]

Public Member Functions

 InventoryService (IPlatformService platform, IBeamableRequester requester)
 
override Promise< InventoryViewGetCurrent (string scope="")
 Get the current data from the given scope. More...
 
- Public Member Functions inherited from Beamable.Common.Api.Inventory.AbsInventoryApi
 AbsInventoryApi (IBeamableRequester requester, IUserContext userContext)
 
Promise< PreviewCurrencyGainResponsePreviewCurrencyGain (Dictionary< string, long > currencyIdsToAmount)
 Players may sometimes receive additional currency as a result of qualifying for a VIP Tier This API previews what that amount of currency would be ahead of an update. More...
 
Promise< GetMultipliersResponseGetMultipliers ()
 Provides the VIP Bonus multipliers that are applicable for this player according to their tier. More...
 
Promise< long > GetCurrency (CurrencyRef currency)
 Gets the currency. More...
 
Promise< UnitAddItem (ItemRef itemRef, Dictionary< string, string > properties=null, string transaction=null)
 
Promise< UnitAddItem (string contentId, Dictionary< string, string > properties=null, string transaction=null)
 
Promise< UnitDeleteItem (string contentId, long itemId, string transaction=null)
 
Promise< UnitUpdateItem (ItemRef itemRef, long itemId, Dictionary< string, string > properties, string transaction=null)
 
Promise< UnitUpdateItem (string contentId, long itemId, Dictionary< string, string > properties, string transaction=null)
 
Promise< UnitSetCurrency (CurrencyRef currency, long amount, string transaction=null)
 Sets the currency. More...
 
Promise< UnitSetCurrencyProperties (string currencyId, List< CurrencyProperty > properties, string transaction=null)
 
Promise< UnitSetCurrencyProperties (CurrencyRef currency, List< CurrencyProperty > properties, string transaction=null)
 
Promise< UnitAddCurrency (string currencyId, long amount, string transaction=null)
 Adds the currency More...
 
Promise< UnitAddCurrency (CurrencyRef currency, long amount, string transaction=null)
 Adds the currency More...
 
Promise< UnitSetCurrencies (Dictionary< CurrencyRef, long > currencyToAmount, string transaction=null)
 
Promise< UnitAddCurrencies (Dictionary< string, long > currencyIdsToAmount, string transaction=null)
 
Promise< UnitAddCurrencies (Dictionary< CurrencyRef, long > currencyToAmount, string transaction=null)
 
Promise< UnitSetCurrency (string currencyId, long amount, string transaction=null)
 Sets the currency. More...
 
Promise< UnitSetCurrencies (Dictionary< string, long > currencyIdsToAmount, string transaction=null)
 
Promise< Dictionary< string, long > > GetCurrencies (string[] currencyIds)
 
Promise< Dictionary< CurrencyRef, long > > GetCurrencies (CurrencyRef[] currencyRefs)
 
Promise< long > GetCurrency (string currencyId)
 Gets the currency. More...
 
Promise< UnitUpdate (Action< InventoryUpdateBuilder > action, string transaction=null)
 
Promise< UnitUpdate (InventoryUpdateBuilder builder, string transaction=null)
 
Promise< List< InventoryObject< TContent > > > GetItems< TContent > ()
 
Promise< List< InventoryObject< TContent > > > GetItems< TContent > (params ItemRef< TContent >[] itemReferences)
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< InventoryView >
Promise< TData > GetCurrent (string scope="")
 

Properties

InventorySubscription Subscribable [get]
 
- Properties inherited from Beamable.Common.Api.Inventory.AbsInventoryApi
IBeamableRequester Requester [get]
 
IUserContext UserContext [get]
 
- Properties inherited from Beamable.Api.IHasPlatformSubscriber< InventorySubscription, InventoryResponse, InventoryView >
TPlatformSubscriber Subscribable [get]
 Allows scopes to consume fresh data when available. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Beamable.Common.Api.Inventory.AbsInventoryApi
const string SERVICE_OBJECT = "object/inventory"
 
- Protected Member Functions inherited from Beamable.Common.Api.Inventory.AbsInventoryApi
string CreateRefreshUrl (string scope)
 

Detailed Description

This type defines the Client main entry point for the Inventory feature.

Related Links

Example

This demonstrates example usage.

private async void SetupBeamable()
{
var beamableAPI = await Beamable.API.Instance;
beamableAPI.InventoryService.Subscribe("items", view =>
{
foreach (KeyValuePair<string, List<ItemView>> kvp in view.items)
{
string inventoryItemName = $"{kvp.Key} x {kvp.Value.Count}"; // "Big Sword x 1"
}
});
}

img beamable-logo

Member Function Documentation

◆ GetCurrent()

override Promise<InventoryView> Beamable.Api.Inventory.InventoryService.GetCurrent ( string  scope = "")
virtual

Get the current data from the given scope.

Parameters
scope
Returns

Implements Beamable.Common.Api.Inventory.AbsInventoryApi.


The documentation for this class was generated from the following file:
Beamable.API
This type defines the Client main entry point for Beamable Client features.
Definition: API.cs:170
Beamable
Definition: AgnosticAttribute.cs:5