PlayerIO

The fastest way to build online games without breaking a sweat.

Objective-C Client Reference

Multiplayer  class documentationClass PIOBuyItemInfo

Language: Objective-C

Represents information about the purchase of a PayVault item.

The minimum information necessary to create an instance of this class is an itemKey representing the PayVaultItem that should be purchased.

It is also possible to add a custom payload, and this data will always be present when reading the item from the user's Vault. For example: Imagine that we have a racing game and users should be able to buy different cars of different colors, but that color doesn't affect the price of the car. Instead of creating one PayVaultItem for each combination of type and color, we need only create one item for each type and give them a different price, and color can then be added in the payload when buying a car.

Setting the payload works exactly like manipulating a DatabaseObject from BigDB.

Methods

 
- (NSArray*)
allProperties
Get the names of all properties on this object
- (NSArray*)
allValues
Get all values from the properties of this object. Primitive properties (integers, floats, etc.) are wrapped in NSNumber
- (PIODatabaseArray*)
arrayForProperty:
Get the given DatabaseArray property
- (BOOL)
boolForProperty:
Get the given boolean property
- (BOOL)
boolForProperty:defaultValue:
Get the given boolean property, or the default if it doesn't exist.
- (void)
clear
Removes all properties on this object
- (BOOL)
containsProperty:
Returns true if the given property exists on this object
- (NSUInteger)
count
Returns the number of properties on this object
- (NSUInteger)
countByEnumeratingWithState:objects:count:
Fast enumeration over the properties in the object
- (NSData*)
dataForProperty:
Get the given byte array property
- (NSData*)
dataForProperty:defaultValue:
Get the given byte array property, or the default if it doesn't exist.
- (NSDate*)
dateForProperty:
Get the given Date property
- (NSDate*)
dateForProperty:defaultValue:
Get the given Date property, or the default if it doesn't exist.
- (double)
doubleForProperty:
Get the given double property
- (double)
doubleForProperty:defaultValue:
Get the given double property, or the default if it doesn't exist.
- (float)
floatForProperty:
Get the given float property
- (float)
floatForProperty:defaultValue:
Get the given float property, or the default if it doesn't exist.
- (id)
initWithItemKey:
Initialize the buy item info with the given key
- (int32_t)
intForProperty:
Get the given int property
- (int32_t)
intForProperty:defaultValue:
Get the given int property, or the default if it doesn't exist.
- (NSString*)
itemKey
The key of the item to buy
+ (PIOBuyItemInfo*)
itemWithKey:
Create a new autoreleased buy item info with the given key
- (NSEnumerator*)
keyEnumerator
Enumerator to move over keys used for properties in the object
- (int64_t)
longForProperty:
Get the given long property
- (int64_t)
longForProperty:defaultValue:
Get the given long property, or the default if it doesn't exist.
- (NSEnumerator*)
objectEnumerator
Enumerator to move over all properties in the object
- (PIODatabaseObject*)
objectForProperty:
Get the given DatabaseObject property
- (PIOBuyItemInfo*)
removeProperty:
Removes the given property from this object
- (PIOBuyItemInfo*)
setArray:forProperty:
Set the specified property to the given DatabaseArray value
- (PIOBuyItemInfo*)
setBool:forProperty:
Set the specified property to the given boolean value
- (PIOBuyItemInfo*)
setData:forProperty:
Set the specified property to the given bye array value
- (PIOBuyItemInfo*)
setDate:forProperty:
Set the specified property to the given Date value
- (PIOBuyItemInfo*)
setDouble:forProperty:
Set the specified property to the given double value
- (PIOBuyItemInfo*)
setFloat:forProperty:
Set the specified property to the given float value
- (PIOBuyItemInfo*)
setInt:forProperty:
Set the specified property to the given int value
- (PIOBuyItemInfo*)
setLong:forProperty:
Set the specified property to the given long value
- (PIOBuyItemInfo*)
setObject:forProperty:
Set the specified property to the given DatabaseObject value
- (PIOBuyItemInfo*)
setString:forProperty:
Set the specified property to the given string value
- (PIOBuyItemInfo*)
setUInt:forProperty:
Set the specified property to the given uint value
- (NSString*)
stringForProperty:
Get the given String property
- (NSString*)
stringForProperty:defaultValue:
Get the given String property, or the default if it doesn't exist.
- (uint32_t)
uintForProperty:
Get the given uint property
- (uint32_t)
uintForProperty:defaultValue:
Get the given uint property, or the default if it doesn't exist.
- (id)
valueForProperty:
Get the given property as an object. Primitive properties (integers, floats, etc.) are wrapped in NSNumber

allProperties

Get the names of all properties on this object

Return Value

NSArray*

allValues

Get all values from the properties of this object. Primitive properties (integers, floats, etc.) are wrapped in NSNumber

Return Value

NSArray*

arrayForProperty:

Get the given DatabaseArray property

Arguments

NSString* propertyExpression

Return Value

PIODatabaseArray*

boolForProperty:

Get the given boolean property

Arguments

NSString* propertyExpression

Return Value

BOOL

boolForProperty:defaultValue:

Get the given boolean property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
BOOL defaultValue

Return Value

BOOL

clear

Removes all properties on this object

containsProperty:

Returns true if the given property exists on this object

Arguments

NSString* propertyExpression

Return Value

BOOL

count

Returns the number of properties on this object

Return Value

NSUInteger

countByEnumeratingWithState:objects:count:

Fast enumeration over the properties in the object

Arguments

NSFastEnumerationState* state
id* stackbuf
NSUInteger len

Return Value

NSUInteger

dataForProperty:

Get the given byte array property

Arguments

NSString* propertyExpression

Return Value

NSData*

dataForProperty:defaultValue:

Get the given byte array property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
NSData* defaultValue

Return Value

NSData*

dateForProperty:

Get the given Date property

Arguments

NSString* propertyExpression

Return Value

NSDate*

dateForProperty:defaultValue:

Get the given Date property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
NSDate* defaultValue

Return Value

NSDate*

doubleForProperty:

Get the given double property

Arguments

NSString* propertyExpression

Return Value

double

doubleForProperty:defaultValue:

Get the given double property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
double defaultValue

Return Value

double

floatForProperty:

Get the given float property

Arguments

NSString* propertyExpression

Return Value

float

floatForProperty:defaultValue:

Get the given float property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
float defaultValue

Return Value

float

initWithItemKey:

Initialize the buy item info with the given key

Arguments

NSString* itemKey

Return Value

id

intForProperty:

Get the given int property

Arguments

NSString* propertyExpression

Return Value

int32_t

intForProperty:defaultValue:

Get the given int property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
int32_t defaultValue

Return Value

int32_t

itemKey

The key of the item to buy

Return Value

NSString*

itemWithKey:

Create a new autoreleased buy item info with the given key

Arguments

NSString* itemKey

Return Value

PIOBuyItemInfo*

keyEnumerator

Enumerator to move over keys used for properties in the object

Return Value

NSEnumerator*

longForProperty:

Get the given long property

Arguments

NSString* propertyExpression

Return Value

int64_t

longForProperty:defaultValue:

Get the given long property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
int64_t defaultValue

Return Value

int64_t

objectEnumerator

Enumerator to move over all properties in the object

Return Value

NSEnumerator*

objectForProperty:

Get the given DatabaseObject property

Arguments

NSString* propertyExpression

Return Value

PIODatabaseObject*

removeProperty:

Removes the given property from this object

Arguments

NSString* propertyExpression
The property to be removed

Return Value

PIOBuyItemInfo* The object instance so that it can be used in chained calls.

setArray:forProperty:

Set the specified property to the given DatabaseArray value

Arguments

PIODatabaseArray* value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setBool:forProperty:

Set the specified property to the given boolean value

Arguments

BOOL value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setData:forProperty:

Set the specified property to the given bye array value

Arguments

NSData* value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setDate:forProperty:

Set the specified property to the given Date value

Arguments

NSDate* value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setDouble:forProperty:

Set the specified property to the given double value

Arguments

double value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setFloat:forProperty:

Set the specified property to the given float value

Arguments

float value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setInt:forProperty:

Set the specified property to the given int value

Arguments

int32_t value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setLong:forProperty:

Set the specified property to the given long value

Arguments

int64_t value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setObject:forProperty:

Set the specified property to the given DatabaseObject value

Arguments

PIODatabaseObject* value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setString:forProperty:

Set the specified property to the given string value

Arguments

NSString* value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

setUInt:forProperty:

Set the specified property to the given uint value

Arguments

uint32_t value
NSString* propertyExpression

Return Value

PIOBuyItemInfo*

stringForProperty:

Get the given String property

Arguments

NSString* propertyExpression

Return Value

NSString*

stringForProperty:defaultValue:

Get the given String property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
NSString* defaultValue

Return Value

NSString*

uintForProperty:

Get the given uint property

Arguments

NSString* propertyExpression

Return Value

uint32_t

uintForProperty:defaultValue:

Get the given uint property, or the default if it doesn't exist.

Arguments

NSString* propertyExpression
uint defaultValue

Return Value

uint32_t

valueForProperty:

Get the given property as an object. Primitive properties (integers, floats, etc.) are wrapped in NSNumber

Arguments

NSString* propertyExpression

Return Value

id