CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Properties | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CotcSdk.PropertiesObject Class Reference

Description

Defines an object that can be queried for additional properties using indexers. The structure of the object remains read only though.

GamerInfo gamer = ...;
// Browse all keys
foreach (KeyValuePair<string, Bundle> pair in gamer) { ... }
// Or using indexers
foreach (string key in gamer.Keys()) { Debug.Log(gamer[key]); }

Usually these objects have a proper structure representing the predefined properties, and you can use the PropertiesObject methods to query additional properties that might have been enriched in a hook for instance.

Beware however, querying a PropertiesObject using keys will return directly what the server has responded. Thus, if you have modified a property and query its equivalent key, the values will differ. That is why we don't usually make PropertiesObjects publicly writable.

Properties

Bundle this[string key] [get]
 Allows to query additional properties via an indexer (can be enriched via hooks). More...
 

Public Member Functions

Bundle AsBundle ()
 Gets the underlying Bundle. Dangerous, only use internally, when you want to put the contents of a properties object into an existing bundle. More...
 
Dictionary< string, Bundle >.KeyCollection Keys ()
 Allows to browse all keys (might include some that are already exposed as typed properties in the object). More...
 
Dictionary< string, Bundle >.Enumerator GetEnumerator ()
 Allows to browse all keys (might include some that are already exposed as typed properties in the object). More...
 
override string ToString ()
 You may use this to debug what is inside this property object. More...
 
string ToJson ()
 Builds a JSON representation of this object, same as ToString actually. More...
 

Protected Member Functions

 PropertiesObject (Bundle baseData)
 

Protected Attributes

Bundle Props
 
Inheritance diagram for CotcSdk.PropertiesObject:
CotcSdk.ConfiguredProduct CotcSdk.Done CotcSdk.DrawnItemsResult CotcSdk.Gamer CotcSdk.GamerInfo CotcSdk.GamerOutline CotcSdk.GamerProfile CotcSdk.GotGodchildEvent CotcSdk.InappPurchase.ProductInfo CotcSdk.IndexResult CotcSdk.Match CotcSdk.MatchEvent CotcSdk.PurchaseTransaction CotcSdk.Score CotcSdk.SocialNetworkFriendResponse CotcSdk.TransactionResult CotcSdk.UserInfo CotcSdk.ValidateReceiptResult

Property Documentation

◆ this[string key]

Bundle CotcSdk.PropertiesObject.this[string key]
get

Allows to query additional properties via an indexer (can be enriched via hooks).

Member Function Documentation

◆ AsBundle()

Bundle CotcSdk.PropertiesObject.AsBundle ( )

Gets the underlying Bundle. Dangerous, only use internally, when you want to put the contents of a properties object into an existing bundle.

◆ GetEnumerator()

Dictionary<string, Bundle>.Enumerator CotcSdk.PropertiesObject.GetEnumerator ( )

Allows to browse all keys (might include some that are already exposed as typed properties in the object).

Returns
An enumerator that allows to browse all key-value pairs. The values are CotcSdk.Bundle, on which you can perform all the usual conversions, such as casting it as a string if the property is expected to be a string for instance.

◆ Keys()

Dictionary<string, Bundle>.KeyCollection CotcSdk.PropertiesObject.Keys ( )

Allows to browse all keys (might include some that are already exposed as typed properties in the object).

Returns
The list of keys.

◆ ToJson()

string CotcSdk.PropertiesObject.ToJson ( )

Builds a JSON representation of this object, same as ToString actually.

Returns
A JSON string representing the object.

◆ ToString()

override string CotcSdk.PropertiesObject.ToString ( )

You may use this to debug what is inside this property object.

Returns
A JSON string representing the object.