Class SaveControllerBase
- Namespace
- Aarthificial.Safekeeper
- Assembly
- Aarthificial.Safekeeper.dll
A handle to the save data.
public class SaveControllerBase
- Inheritance
-
SaveControllerBase
- Inherited Members
Constructors
SaveControllerBase(ISaveLoader)
public SaveControllerBase(ISaveLoader loader)
Parameters
loader
ISaveLoader
Fields
Name
public string Name
Field Value
Properties
Data
The save data.
public ISaveData Data { get; }
Property Value
Remarks
The data can only be accessed after the save has been loaded for the first time. Otherwise it returns an empty SaveData.
Exists
Whether the save exists.
public bool Exists { get; }
Property Value
IsLoading
Whether the save is currently being loaded.
public bool IsLoading { get; }
Property Value
Methods
Create()
Create the save if it doesn't exist.
public Task Create()
Returns
Delete()
Delete the save.
public Task Delete()
Returns
Initialize()
Initialize this save controller.
public void Initialize()
Remarks
This process loads the basic information about the save, such as its name and whether it exists. It does not load the data itself.
Load(SaveMode)
Load the game state.
public Task Load(SaveMode mode = SaveMode.MemoryOnly)
Parameters
mode
SaveMode
Returns
OnDelete()
Invoked when the save is deleted.
protected virtual void OnDelete()
OnLoad()
Invoked when the save is loaded from the memory.
protected virtual void OnLoad()
Remarks
This method is guaranteed to be called before the ISaveStores are notified. It can be used to load global data unrelated to scenes.
OnSave()
Invoked when the save is being saved to the memory.
protected virtual void OnSave()
Remarks
This method is called after ISaveStores are notified. It can be used to save global data unrelated to scenes.
Save(SaveMode)
Save the game state.
public Task Save(SaveMode mode = SaveMode.MemoryOnly)
Parameters
mode
SaveMode
Returns
Events
Saved
public event Action Saved
Event Type
Saving
public event Action Saving