Skip to main content

TypeSerializationHelper.SubClassSerialization<T>

A class in Root.Township, the global namespace.

Serializer for plain classes: a null flag, then each of the class's fields through ClassSerializationHelper. Made on demand by GetSerialization.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private TypeSerializationHelper.ObjectActivator activatorCompiled constructor used to make instances when reading.
private Action<T, Stream, ChunkVersioning> serializerCombined delegate that reads or writes all the class's fields.

Methods​

MemberWhat it is
override void Initialize()Builds the field serializer for the class with ClassSerializationHelper.Prepare.
protected override void Serialize(Type type, ref T value, Stream stream, ChunkVersioning versioning)Writes a null flag then the fields, or reads the flag and creates and fills a new instance.