Table of Contents

Interface ISaveData

Namespace
Aarthificial.Safekeeper
Assembly
Aarthificial.Safekeeper.dll

A common interface for representing the save data.

public interface ISaveData

Methods

GetChunk(string)

Get the chunk with the given ID or create a new one if it doesn't exist.

Dictionary<string, string> GetChunk(string chunkId)

Parameters

chunkId string

The chunk ID.

Returns

Dictionary<string, string>

The retrieved chunk.

GetChunkIds()

Get the IDs of all existing chunks.

IEnumerable<string> GetChunkIds()

Returns

IEnumerable<string>

Read<T>(SaveLocation)

Read the save data from the given location.

T Read<T>(SaveLocation location) where T : new()

Parameters

location SaveLocation

The location to read from.

Returns

T

A new instance of the data type.

Type Parameters

T

The type of the data.

Read<T>(SaveLocation, T)

Read the save data from the given location into the given target.

bool Read<T>(SaveLocation location, T target)

Parameters

location SaveLocation

The location to read from.

target T

The target to read into.

Returns

bool

Whether the data was read.

Type Parameters

T

The type of the data.

Write(SaveLocation, object)

Write the given value to the given location.

void Write(SaveLocation location, object value)

Parameters

location SaveLocation

The location to write to.

value object

The value to write.