CloudOnce v2.7.5
Unified Game Services API
CloudOnce.Internal.PersistentValue< T > Class Template Reference

A preference that is stored in the cloud. More...

Inheritance diagram for CloudOnce.Internal.PersistentValue< T >:
[legend]
Collaboration diagram for CloudOnce.Internal.PersistentValue< T >:
[legend]

Public Member Functions

void Load (bool force=false)
 Invokes the ValueLoader. More...
 
void Flush ()
 Invokes the ValueSetter. More...
 
void Reset ()
 Resets the value back to it's default value. More...
 
void Flush ()
 Invokes the cloud preference's delegate used to save data. More...
 
void Load (bool force=false)
 Invokes the cloud preference's delegate used to load data. More...
 
void Reset ()
 Resets the IPersistent to default/initial value. More...
 

Protected Member Functions

 PersistentValue (string key, PersistenceType type, T value, T defaultValue, ValueLoaderDelegate valueLoader, ValueSetterDelegate valueSetter)
 A preference that is stored in the cloud. Automatically added to the DataManager. More...
 
delegate T ValueLoaderDelegate (string key, T defaultValue)
 
delegate void ValueSetterDelegate (string key, T value, PersistenceType persistenceType)
 

Properties

string Key [get]
 The unique identifier used to identify this particular value.
 
Value [get, set]
 The current value for this preference. Takes PersistenceType into account when setting.
 
PersistenceType PersistenceType [get]
 The method of conflict resolution to be used in case of a data conflict. Can happen if the data is altered by a different device.
 
DefaultValue [get]
 The value the preference will be set to if it is ever reset.
 

Detailed Description

A preference that is stored in the cloud.

Template Parameters
TThe type of preference.

Constructor & Destructor Documentation

◆ PersistentValue()

CloudOnce.Internal.PersistentValue< T >.PersistentValue ( string  key,
PersistenceType  type,
value,
defaultValue,
ValueLoaderDelegate  valueLoader,
ValueSetterDelegate  valueSetter 
)
inlineprotected

A preference that is stored in the cloud. Automatically added to the DataManager.

Parameters
keyA unique identifier used to identify this particular value.
typeThe method of conflict resolution to be used in case of a data conflict. Can happen if the data is altered by a different device.
valueThe starting value for this preference.
defaultValueThe value the preference will be set to if it is ever reset.
valueLoaderdelegate used to get the preference.
valueSetterdelegate used to set the preference.

Member Function Documentation

◆ Flush()

void CloudOnce.Internal.PersistentValue< T >.Flush ( )
inline

Invokes the ValueSetter.

Implements CloudOnce.Internal.IPersistent.

◆ Load()

void CloudOnce.Internal.PersistentValue< T >.Load ( bool  force = false)
inline

Invokes the ValueLoader.

Implements CloudOnce.Internal.IPersistent.

◆ Reset()

void CloudOnce.Internal.PersistentValue< T >.Reset ( )
inline

Resets the value back to it's default value.

Implements CloudOnce.Internal.IPersistent.


The documentation for this class was generated from the following file: