Skip to main content

BasicSaveFile<T>

A class in Root.Township, Alta.Saving.

File format that stores one BasicSaveData object in an Alta file, through a BasicSaveDataWrapper.

Constructors​

MemberWhat it is
BasicSaveFile()Creates a BasicSaveFile with default values.

Fields​

1 private and internal field
MemberWhat it is
private BasicSaveDataWrapper<T> wrapperWrapper that holds and serializes the data.

Properties​

MemberWhat it is
T Data { get; set; }The stored save data.

Methods​

MemberWhat it is
override IAltaFileFormat Clone()Copies the file with a cloned wrapper.
override void Dispose()Disposes the wrapper too.
void MarkModified()Marks the data as changed so it gets written.
static async Task<T> ReadAndUnload(IAltaFile file)Reads the file, queues it to unload and returns its data, or null.
override void ReadFrom(FileInfo info, Stream stream)Reads the wrapper from the file stream.
static void WriteAndUnload(IAltaFile file, T data)Puts the data in the file, starts an async write and queues the file to unload.
override void WriteTo(Stream stream, CancellationToken token)Writes the wrapper to the file stream.