userpurchasemanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

UserPurchaseManager

together.UserPurchaseManager

Overview

The UserPurchaseManager class contains a collection UserPurchases. With this class, a developer will be able to Create and Retrieve All their UserPurchases.


Members

List<UserPurchase> UserPurchases

Stores all the UserPurchases contained in the Manager.


Methods


Add()

Adds a UserPurchase to the internally managed list without persistence.

Note
This methos is deprecated

Returns void
Syntax
UserPurchaseManager.Add( userPurchase )
Parameters

UserPurchase userPurchase

Instance of a UserPurchase to add internally

--------------------------------------------------------------------------------

FindByUserPurchaseID()

Finds the UserPurchase with the specified UserPurchaseID if it exists, otherwise returns null

Returns UserPurchase
Syntax
UserPurchaseManager.FindByUserPurchaseID( userPurchaseID )
Parameters

long userPurchaseID

The ID of the UserPurchase to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of UserPurchases currently managed internally.

Returns int
Syntax
UserPurchaseManager.GetCount(  )

Get()

Gets the UserPurchase at the specified index if it exists, otherwise returns null.

Returns UserPurchase
Syntax
UserPurchaseManager.Get( index )
Parameters

int index

The index of the UserPurchase to find

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified UserPurchase if it exists, otherwise returns -1.

Returns int
Syntax
UserPurchaseManager.IndexOf( userItem )
Parameters

UserPurchase userItem

Instance of the UserPurchase to find the index of

--------------------------------------------------------------------------------

IndexOfByUserPurchaseID()

Returns the index of the UserPurchase with the specified UserPurchaseID if it exists, otherwise returns -1.

Returns int
Syntax
UserPurchaseManager.IndexOfByUserPurchaseID( userPurchaseID )
Parameters

long userPurchaseID

The ID of the UserPurchase to find the index of

--------------------------------------------------------------------------------

Remove()

Removes a UserPurchase from the internally managed list. This does not delete the purchase from the user's account persistently.

Note
This method is deprecated

Returns void
Syntax
UserPurchaseManager.Remove( index )
Parameters

int index

The index of the UserPurchase to remove internally

--------------------------------------------------------------------------------

Create()

Creates a new UserPurchase record. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserPurchaseManager.Create( roomID, achievementID, itemID, description, count, userPurchaseProperties, callbackFunc )
Parameters

long roomID

The ID of the room where the purchase occurred. Pass in 0 for no room.

[long](#) achievementID

The ID of the achievement that was purchase.

[long](#) itemID

The ID of the item that was purchased.

[string](#) description

A textual description of the purchase.

[int](#) count

the Number of (Achievements, Items, things) purchased.

[PropertyCollection](./propertycollection) userPurchaseProperties

The properties to assign to the UserPurchase record. Pass an instance to link properties. Pass null to assign no properties.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

GetAll()

Gets all UserPurchases done by a User. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserPurchaseManager.GetAll( callbackFunc )
Parameters

OnCompleteHandler callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️