Table of Contents

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

string

Properties

Data

The save data.

public ISaveData Data { get; }

Property Value

ISaveData

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

bool

IsLoading

Whether the save is currently being loaded.

public bool IsLoading { get; }

Property Value

bool

Methods

Create()

Create the save if it doesn't exist.

public Task Create()

Returns

Task

Delete()

Delete the save.

public Task Delete()

Returns

Task

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

Task

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

Task

Events

Saved

public event Action Saved

Event Type

Action

Saving

public event Action Saving

Event Type

Action