Show / Hide Table of Contents

    Interface ISerializer

    Interface for serializing the data whether it is local or remote.

    Namespace: IdleKit.Gameplay
    Assembly: cs.temp.dll.dll
    Syntax
    public interface ISerializer

    Properties

    DirtyData

    Return the ISavedData that have been MarkDirty<TSaveData>(String, TSaveData) but not Serialize<TSaveData>(String, TSaveData) yet.

    Declaration
    ISavedData[] DirtyData { get; }
    Property Value
    Type Description
    ISavedData[]

    HasDirtyData

    Return if there are ISavedData that have been MarkDirty<TSaveData>(String, TSaveData).

    Declaration
    bool HasDirtyData { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Delete<TSavedData>(String, TSavedData)

    Delete the ISavedData with the savedId

    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()

    Delete all the ISavedData. Use this with caution.

    Declaration
    void DeleteAll()

    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 Description
    Boolean
    Type Parameters
    Name Description
    TSavedData

    Initialize()

    Initializes the ISerializer and allows it to prepare any dependencies before deserializing data.

    Declaration
    void Initialize()

    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
    Back to top Copyright © 2020 East Side Games Inc.