Skip to main content

ClassSerializer<T>

A class in Root.Township, the global namespace.

A Sync that writes a plain object to an entity message by calling a serialize delegate you pass in, using the latest chunk versioning.

Constructors​

MemberWhat it is
ClassSerializer(NetworkEntity entity, T target, EntityMessageType messageType, Action<T, Stream, ChunkVersioning> sync)Creates a ClassSerializer from entity, target, messageType and sync.

Fields​

2 private and internal fields
MemberWhat it is
private Action<T, Stream, ChunkVersioning> syncThe delegate that writes the target object to a stream.
private T targetThe object being synced.

Properties​

MemberWhat it is
override SerializeMethod Handler { get; }Returns Serialize as this sync's serialize method.

Methods​

MemberWhat it is
void Serialize(IPlayer player, Stream stream)Writes target to the stream for a player by calling the sync delegate.

Used in​

Members of other types that take, return or hold a ClassSerializer&lt;T>: