CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Public Member Functions | List of all members

Description

Allows to manipulate the gamer properties.

Public Member Functions

GamerProperties Domain (string domain)
 Sets the domain affected by this object. You should typically use it this way: gamer.Properties.Domain("private").Post(...); More...
 
Promise< BundleGetKey (string key)
 Retrieves an individual key from the gamer properties. More...
 
Promise< BundleGetAll ()
 Retrieves all the properties of the gamer. More...
 
Promise< DoneSetKey (string key, Bundle value)
 Sets a single key from the user properties. More...
 
Promise< DoneSetAll (Bundle properties)
 Sets all keys at once. More...
 
Promise< DoneRemoveKey (string key)
 Removes a single key from the user properties. More...
 
Promise< DoneRemoveAll ()
 Remove all properties for the user. More...
 

Member Function Documentation

◆ Domain()

GamerProperties CotcSdk.GamerProperties.Domain ( string  domain)

Sets the domain affected by this object. You should typically use it this way: gamer.Properties.Domain("private").Post(...);

Parameters
domainOptional domain on which to scope the properties. Default to private if unmodified.
Returns
This object for operation chaining.

◆ GetAll()

Promise<Bundle> CotcSdk.GamerProperties.GetAll ( )

Retrieves all the properties of the gamer.

Returns
Promise resolved when the operation has completed. The attached bundle contains the keys along with their values. If you would like to fetch the value of a given key and you expect it to be a string, you may simply do string value = result.Value["key"];. Bundle handles automatic conversions as well, so if you passed an integer, you may as well fetch it as a string and vice versa.

◆ GetKey()

Promise<Bundle> CotcSdk.GamerProperties.GetKey ( string  key)

Retrieves an individual key from the gamer properties.

Returns
Promise resolved when the operation has completed. The attached bundle contains the fetched property. As usual with bundles, it can be casted to the proper type you are expecting. In case the call fails, the bundle is not attached, the call is marked as failed with a 404 status.
Parameters
keyThe name of the key to be fetched.

◆ RemoveAll()

Promise<Done> CotcSdk.GamerProperties.RemoveAll ( )

Remove all properties for the user.

Returns
Promise resolved when the operation has completed.

◆ RemoveKey()

Promise<Done> CotcSdk.GamerProperties.RemoveKey ( string  key)

Removes a single key from the user properties.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to remove.

◆ SetAll()

Promise<Done> CotcSdk.GamerProperties.SetAll ( Bundle  properties)

Sets all keys at once.

Returns
Promise resolved when the operation has completed. The enclosed value indicates success.
Parameters
propertiesA bundle of key/value properties to set. An example is Bundle.CreateObject("key", "value").

◆ SetKey()

Promise<Done> CotcSdk.GamerProperties.SetKey ( string  key,
Bundle  value 
)

Sets a single key from the user properties.

Returns
Promise resolved when the operation has completed. The enclosed value indicates success.
Parameters
keyThe name of the key to set the value for.
valueThe value to set. As usual with bundles, casting is implicitly done, so you may as well call this method passing an integer or string as value for instance.