C# Class SpilGames.Unity.Helpers.PlayerDataHelper

This is the business object that the developer can use to work with Player Data (Wallet and Inventory). Much easier to work with than the raw data!
Mostra file Open project: spilgames/spil_event_unity_plugin

Public Properties

Property Type Description
Inventory Inventory
Wallet Wallet

Public Methods

Method Description
BuyBundle ( int bundleId, string reason ) : void

Helper method that consumes the bundle given a bundleId and a reason

ConsumeBundle ( int bundleId, string reason ) : void

Helper method that consumes the bundle given a bundleId and a reason

GetCurrencyBalance ( int currencyId ) : int

Helper method that returns the Currency Balance given a currencyId Returns -1 if no currency was found

GetItemAmount ( int itemId ) : int

Helper method that returns the Item Amount given a itemId Returns -1 if no item was found

InventoryHasItem ( int itemId ) : System.Boolean

Helper method that returns true if an item is in the inventory

PlayerDataHelper ( SpilUnityImplementationBase Instance ) : System
PlayerDataUpdatedHandler ( ) : void

Private Methods

Method Description
AddDataToHelper ( List walletCurrencies, List inventoryItems ) : void
UpdatePlayerData ( ) : void

Method Details

BuyBundle() public method

Helper method that consumes the bundle given a bundleId and a reason
public BuyBundle ( int bundleId, string reason ) : void
bundleId int
reason string
return void

ConsumeBundle() public method

Helper method that consumes the bundle given a bundleId and a reason
public ConsumeBundle ( int bundleId, string reason ) : void
bundleId int
reason string
return void

GetCurrencyBalance() public method

Helper method that returns the Currency Balance given a currencyId Returns -1 if no currency was found
public GetCurrencyBalance ( int currencyId ) : int
currencyId int
return int

GetItemAmount() public method

Helper method that returns the Item Amount given a itemId Returns -1 if no item was found
public GetItemAmount ( int itemId ) : int
itemId int
return int

InventoryHasItem() public method

Helper method that returns true if an item is in the inventory
public InventoryHasItem ( int itemId ) : System.Boolean
itemId int
return System.Boolean

PlayerDataHelper() public method

public PlayerDataHelper ( SpilUnityImplementationBase Instance ) : System
Instance SpilUnityImplementationBase
return System

PlayerDataUpdatedHandler() public method

public PlayerDataUpdatedHandler ( ) : void
return void

Property Details

Inventory public_oe property

public Inventory,SpilGames.Unity.Helpers Inventory
return Inventory

Wallet public_oe property

public Wallet,SpilGames.Unity.Helpers Wallet
return Wallet