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
slotsint
Properties
Backups
Contents moved away by unreadable loads.
public IReadOnlyList<string> Backups { get; }
Property Value
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
Returns
DeleteText(int)
Removes a slot.
protected override void DeleteText(int slot)
Parameters
slotint
GetText(int)
Raw text of a slot (null when empty), for tests.
public string GetText(int slot)
Parameters
slotint
Returns
HasText(int)
Whether a slot holds text.
protected override bool HasText(int slot)
Parameters
slotint
Returns
ReadText(int)
Reads the raw text of a slot, or null when it is empty.
protected override string ReadText(int slot)
Parameters
slotint
Returns
SetText(int, string)
Sets the raw text of a slot, for tests (null clears it).
public void SetText(int slot, string text)
Parameters
WriteText(int, string)
Writes the raw text of a slot.
protected override void WriteText(int slot, string text)