Table of Contents

Class SaveData

Namespace
Aarthificial.Safekeeper
Assembly
Aarthificial.Safekeeper.dll

A basic implementation of ISaveData that uses JSON serialization.

public class SaveData : ISaveData
Inheritance
SaveData
Implements
Inherited Members

Methods

GetChunk(string)

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

public Dictionary<string, string> GetChunk(string chunkId = null)

Parameters

chunkId string

The chunk ID.

Returns

Dictionary<string, string>

The retrieved chunk.

GetChunkIds()

Get the IDs of all existing chunks.

public IEnumerable<string> GetChunkIds()

Returns

IEnumerable<string>

Read<T>(SaveLocation)

Read the save data from the given location.

public 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.

public 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.

public void Write(SaveLocation location, object value)

Parameters

location SaveLocation

The location to write to.

value object

The value to write.