CloudOnce v2.7.5
Unified Game Services API
|
Handles virtual currencies. Keeps a record of all the earnings and purchases for every device the user has. This way the balance should always be accurate. More...
Public Member Functions | |
SyncableCurrency (string currencyID) | |
Initializes a new instance of the SyncableCurrency class. More... | |
SyncableCurrency (JSONObject jsonSerializedCurrency) | |
Initializes a new instance of the SyncableCurrency class. Reconstructs the currency from a serialized string. More... | |
JSONObject | ToJSONObject () |
Serializes the currency into a JSONObject. More... | |
void | FromJSONObject (JSONObject jsonObject) |
Recreates the currency from a JSONObject. More... | |
bool | MergeWith (SyncableCurrency otherData) |
Merges the currency with another record of it, most likely gotten from the cloud More... | |
void | ResetCurrency () |
Use with caution! Completely resets currency. All additions and subtractions for every registered device are lost. | |
JSONObject | ToJSONObject () |
void | FromJSONObject (JSONObject jsonObject) |
Properties | |
string | CurrencyID [get] |
Unique identifier for this currency. | |
Dictionary< string, CurrencyValue > | DeviceCurrencyValues [get, set] |
Dictionary containing device IDs and currency values for each. | |
Handles virtual currencies. Keeps a record of all the earnings and purchases for every device the user has. This way the balance should always be accurate.
|
inline |
Initializes a new instance of the SyncableCurrency class.
currencyID | A unique identifier for this currency. |
|
inline |
Initializes a new instance of the SyncableCurrency class. Reconstructs the currency from a serialized string.
jsonSerializedCurrency | A currency represented by a serialized string |
|
inline |
Recreates the currency from a JSONObject.
jsonObject | JSONObject containing the currency data. |
Implements CloudOnce.Internal.IJsonDeserializable.
|
inline |
Merges the currency with another record of it, most likely gotten from the cloud
otherData | The other record of the same currency |
true
if there was any change to this SyncableCurrency, false
if there was no new data.
|
inline |
Serializes the currency into a JSONObject.
Implements CloudOnce.Internal.IJsonSerializable.