Skip to content

PlatformAPI reference

Interface IStorage

Namespace: MicroEngine.Platform
Assembly: MicroEngine.Platform.dll
Guide: The platform host

Where a game keeps what it saves: named slots of text that are written whole (files on desktops and phones, the page’s localStorage in browsers, a cloud service). Failures surface as IOException or UnauthorizedAccessException.

C#
public interface IStorage

Properties

Location

The save folder, or a description of the medium for diagnostics.

C#
string Location { get; }

Property Value

string

Methods

Delete(string)

Removes the slot; does nothing when it does not exist.

C#
void Delete(string slot)

Parameters

slot string

Exists(string)

Whether the slot has data.

C#
bool Exists(string slot)

Parameters

slot string

Returns

bool

Read(string)

The slot’s text, or null when it does not exist.

C#
string? Read(string slot)

Parameters

slot string

Returns

string?

SetAside(string)

Moves unreadable data out of the slot, keeping a copy; best effort, never throws.

C#
void SetAside(string slot)

Parameters

slot string

Write(string, string)

Replaces the slot atomically.

C#
void Write(string slot, string text)

Parameters

slot string

text string