Interface ISerializer
Interface for serializing the data whether it is local or remote.
Assembly: cs.temp.dll.dll
Syntax
public interface ISerializer
Properties
DirtyData
Declaration
ISavedData[] DirtyData { get; }
Property Value
HasDirtyData
Declaration
bool HasDirtyData { get; }
Property Value
Methods
Delete<TSavedData>(String, TSavedData)
Declaration
void Delete<TSavedData>(string savedId, TSavedData savedData)
where TSavedData : ISavedData
Parameters
Type |
Name |
Description |
String |
savedId |
|
TSavedData |
savedData |
|
Type Parameters
Name |
Description |
TSavedData |
|
DeleteAll()
Declaration
Deserialize<TSavedData>(String, ref TSavedData)
Deserialize the ISavedData with the savedId
. Returns true if the operation is successful.
Fails otherwise.
Declaration
bool Deserialize<TSavedData>(string savedId, ref TSavedData savedData)
where TSavedData : ISavedData
Parameters
Type |
Name |
Description |
String |
savedId |
|
TSavedData |
savedData |
|
Returns
Type Parameters
Name |
Description |
TSavedData |
|
Initialize()
Initializes the ISerializer and allows it to prepare any dependencies before deserializing data.
Declaration
MarkDirty<TSaveData>(String, TSaveData)
Mark the ISavedData with the savedId
dirty so it can be serialized later.
Declaration
void MarkDirty<TSaveData>(string savedId, TSaveData objectToSerialize)
where TSaveData : ISavedData
Parameters
Type |
Name |
Description |
String |
savedId |
|
TSaveData |
objectToSerialize |
|
Type Parameters
Name |
Description |
TSaveData |
|
Serialize<TSaveData>(String, TSaveData)
Forcefully serialize the ISavedData with the savedId
.
Declaration
void Serialize<TSaveData>(string savedId, TSaveData objectToSerialize)
where TSaveData : ISavedData
Parameters
Type |
Name |
Description |
String |
savedId |
|
TSaveData |
objectToSerialize |
|
Type Parameters
Name |
Description |
TSaveData |
|
SerializeDirty(Action)
Serialize all the TSavedData that have been marked dirty and run an optional callback when completed.
Declaration
void SerializeDirty(Action onCompleteCallback = null)
Parameters
Type |
Name |
Description |
Action |
onCompleteCallback |
|