Skip to main content

TypeSerializationHelper.SaveDataSerialization<T>

A class in Root.Township, the global namespace.

Serializer for SaveData objects: writes the save structure hash, the data's bit length, then the data, probably so readers can skip structures they do not know.

Constructors​

MemberWhat it is
SaveDataSerialization()Creates a TypeSerializationHelper.SaveDataSerialization with default values.

Properties​

MemberWhat it is
static TypeSerializationHelper.SaveDataSerialization<T> Instance { get; }Shared instance, used by LogicManagerSetSerialization.

Methods​

MemberWhat it is
void SerializeExt(ref T data, Stream stream, ChunkVersioning versioning)Public entry point that calls Serialize with no type.
protected override void Serialize(Type type, ref T data, Stream stream, ChunkVersioning versioning)Writes hash, length and data (0 for null), or reads them through SavingSystem.Load, calling SavingSystem.ReadMissing when that fails.