![]() |
CotC C# SDK for Unity
v1.4.0.1
Making social games is easy !
|
Never instantiate this class. Use Bundle.Empty instead. Pass that everywhere an explicit configuration is not wanted.
Properties | |
override Bundle | this[string key] [get, set] |
Gets empty Bundle (as an empty Bundle can't contain anything else). More... | |
override Bundle | this[int index] [get, set] |
Gets empty Bundle (as an empty Bundle can't contain anything else). More... | |
![]() | |
virtual Bundle? | this[string key] [get, set] |
Gets object type (Dictionary) Bundle's key value. More... | |
virtual Bundle | this[int index] [get, set] |
Gets array type (List) Bundle's index value. More... | |
bool | IsEmpty [get] |
Tests if a Bundle (any type) has any value set. More... | |
Bundle | Root [get] |
Returns the root of this tree. Goes as far as possible back in the hierarchy. More... | |
DataType | Type [get] |
Gets Bundle's value data type. Should be DataType.None until any value is set to this Bundle. More... | |
Bundle | Parent [get] |
Returns the parent of this bundle, if it was detached from any tree. May be null if it is the root or has never been attached. More... | |
Additional Inherited Members | |
![]() | |
enum | DataType { None, Boolean, Integer, Double, String, Array, Object } |
Possible types of data storable into a bundle. More... | |
![]() | |
Bundle (bool value) | |
Creates a new Bundle of Boolean type from a bool value. More... | |
Bundle (int value) | |
Creates a new Bundle of Integer type from an int value. More... | |
Bundle (long value) | |
Creates a new Bundle of Integer type from a long value. More... | |
Bundle (float value) | |
Creates a new Bundle of Double type from a float value. More... | |
Bundle (double value) | |
Creates a new Bundle of Double type from a double value. More... | |
Bundle (string value) | |
Creates a new Bundle of String type from a string value. More... | |
override int | GetHashCode () |
Call the standard Object.GetHashCode() method to compute a hash code for this Bundle. More... | |
bool | Equals (Bundle b) |
Compares the Bundle with another one to find out if they are equal. Compares instances references first, then tries to compare Bundles' values. Warning: The converted values are actually compared, then a "1" integer or string type Bundle would match a "true" bool type Bundle for example. More... | |
override bool | Equals (object obj) |
Compares the Bundle with any object (expected to be another Bundle) to find out if they are equal. Compares instances references first, then tries to compare Bundles' values. Warning: The converted values are actually compared, then a "1" integer or string type Bundle would match a "true" bool type Bundle for example. More... | |
bool | Has (string key) |
Tests if an object type (Dictionary) Bundle has a given key defined. More... | |
void | Remove (string key) |
Removes an object type (Dictionary) Bundle's key value. More... | |
void | Add (Bundle value) |
Adds a Bundle value to this array-type (List) Bundle. More... | |
Bundle | Clone () |
Deep copies the bundle. More... | |
bool | GetBool (string key, bool defaultValue=false) |
Gets an object type (Dictionary) Bundle's key bool value. More... | |
int | GetInt (string key, int defaultValue=0) |
Gets an object type (Dictionary) Bundle's key int value. More... | |
long | GetLong (string key, long defaultValue=0L) |
Gets an object type (Dictionary) Bundle's key long value. More... | |
float | GetFloat (string key, float defaultValue=0f) |
Gets an object type (Dictionary) Bundle's key float value. More... | |
double | GetDouble (string key, double defaultValue=0d) |
Gets an object type (Dictionary) Bundle's key double value. More... | |
string | GetString (string key, string defaultValue=null) |
Gets an object type (Dictionary) Bundle's key string value. More... | |
bool | GetBool (int index, bool defaultValue=false) |
Gets an array type (List) Bundle's index bool value. More... | |
int | GetInt (int index, int defaultValue=0) |
Gets an array type (List) Bundle's index int value. More... | |
long | GetLong (int index, long defaultValue=0L) |
Gets an array type (List) Bundle's index long value. More... | |
float | GetFloat (int index, float defaultValue=0f) |
Gets an array type (List) Bundle's index float value. More... | |
double | GetDouble (int index, double defaultValue=0d) |
Gets an array type (List) Bundle's index double value. More... | |
string | GetString (int index, string defaultValue=null) |
Gets an array type (List) Bundle's index string value. More... | |
bool | AsBool (bool defaultValue=false) |
Gets a Bundle's value as a bool converted value. More... | |
int | AsInt (int defaultValue=0) |
Gets a Bundle's value as a int converted value. More... | |
long | AsLong (long defaultValue=0L) |
Gets a Bundle's value as a long converted value. More... | |
float | AsFloat (float defaultValue=0f) |
Gets a Bundle's value as a float converted value. More... | |
double | AsDouble (double defaultValue=0d) |
Gets a Bundle's value as a double converted value. More... | |
string | AsString (string defaultValue=null) |
Gets a Bundle's value as a string converted value. More... | |
Dictionary< string, Bundle > | AsDictionary () |
Gets object type Bundle as a Dictionary. More... | |
List< Bundle > | AsArray () |
Gets array type Bundle as a List. More... | |
string | ToJson () |
Gets all bundle's data as a json-like string. More... | |
override string | ToString () |
Gets all bundle's data as a human readable string. (actually calls ToJson()) More... | |
![]() | |
static Bundle | CreateObject () |
Creates a bundle of type object. More... | |
static Bundle | CreateObject (string key, Bundle value) |
Creates a bundle of type object with one key/value pair which will be put in the object initially. More... | |
static Bundle | CreateObject (string key1, Bundle value1, string key2, Bundle value2) |
Creates a bundle of type object with two key/value pairs which will be put in the object initially. More... | |
static Bundle | CreateObject (string key1, Bundle value1, string key2, Bundle value2, string key3, Bundle value3) |
Creates a bundle of type object with three key/value pairs which will be put in the object initially. More... | |
static Bundle | CreateObject (params KeyValuePair< string, Bundle >[] keyValuePairs) |
Creates a bundle of type object with many key/value pairs which will be put in the object initially. More... | |
static Bundle | CreateArray (params Bundle[] values) |
Creates a bundle of type array. More... | |
static implicit | operator Bundle (bool value) |
Implicitly creates a new Bundle of Boolean type from a bool value. More... | |
static implicit | operator Bundle (int value) |
Implicitly creates a new Bundle of Integer type from an int value. More... | |
static implicit | operator Bundle (long value) |
Implicitly creates a new Bundle of Integer type from a long value. More... | |
static implicit | operator Bundle (float value) |
Implicitly creates a new Bundle of Double type from a float value. More... | |
static implicit | operator Bundle (double value) |
Implicitly creates a new Bundle of Double type from a double value. More... | |
static implicit | operator Bundle (string value) |
Implicitly creates a new Bundle of String type from a string value. More... | |
static implicit | operator bool (Bundle b) |
Implicitly gets a Bundle's value as a bool converted value. More... | |
static implicit | operator int (Bundle b) |
Implicitly gets a Bundle's value as an int converted value. More... | |
static implicit | operator long (Bundle b) |
Implicitly gets a Bundle's value as a long converted value. More... | |
static implicit | operator float (Bundle b) |
Implicitly gets a Bundle's value as a float converted value. More... | |
static implicit | operator double (Bundle b) |
Implicitly gets a Bundle's value as a double converted value. More... | |
static implicit | operator string (Bundle b) |
Implicitly gets a Bundle's value as a string converted value. More... | |
static bool | operator== (Bundle b, object obj) |
Compares the Bundle with any object (expected to be another Bundle) to find out if they are equal. Compares instances references first, then tries to compare Bundles' values. Warning: The converted values are actually compared, then a "1" integer or string type Bundle would match a "true" bool type Bundle for example. More... | |
static bool | operator != (Bundle b, object obj) |
Compares the Bundle with any object (expected to be another Bundle) to find out if they are different. Compares instances references first, then tries to compare Bundles' values. Warning: The converted values are actually compared, then a "1" integer or string type Bundle would match a "true" bool type Bundle for example. More... | |
static Bundle | FromAnyJson (string json) |
Builds a complete Bundle hierarchy representing data from a json-like string. Works even if the root json token is a simple value type like a string or a number. More... | |
static Bundle | FromJson (string json) |
Builds a complete Bundle hierarchy representing data from a json-like string. Works only if the root json token is an object or an array, but not a simple value type like a string or a number (in this case use FromAnyJson() instead). More... | |
![]() | |
static readonly EmptyBundle | Empty = new EmptyBundle() |
Empty (null-like) Bundle. See class documentation for more information. More... | |
![]() | |
Bundle (DataType dataType) | |
Builds a fresh new Bundle from a data type. More... | |
|
getset |