Class MemorySaveStore

Namespace
TDMaker.Unity.Campaign
Assembly
TDMaker.Unity.dll

In-memory store (nothing persists): for tests, previews and tools.

public sealed class MemorySaveStore : TextSaveStore, ISaveStore
Inheritance
MemorySaveStore
Implements
Inherited Members

Constructors

MemorySaveStore(int)

Creates an empty store.

public MemorySaveStore(int slots = 3)

Parameters

slots int

Properties

Backups

Contents moved away by unreadable loads.

public IReadOnlyList<string> Backups { get; }

Property Value

IReadOnlyList<string>

Methods

Backup(int, string)

Moves unreadable slot content out of the way, keeping it. Returns where it went (for the warning).

protected override string Backup(int slot, string text)

Parameters

slot int
text string

Returns

string

DeleteText(int)

Removes a slot.

protected override void DeleteText(int slot)

Parameters

slot int

GetText(int)

Raw text of a slot (null when empty), for tests.

public string GetText(int slot)

Parameters

slot int

Returns

string

HasText(int)

Whether a slot holds text.

protected override bool HasText(int slot)

Parameters

slot int

Returns

bool

ReadText(int)

Reads the raw text of a slot, or null when it is empty.

protected override string ReadText(int slot)

Parameters

slot int

Returns

string

SetText(int, string)

Sets the raw text of a slot, for tests (null clears it).

public void SetText(int slot, string text)

Parameters

slot int
text string

WriteText(int, string)

Writes the raw text of a slot.

protected override void WriteText(int slot, string text)

Parameters

slot int
text string