Skip to main content

MethodSyncClass<T>

A class in Root.Township, Alta.Networking.

An entity network method whose handler gets a class instance to read into or write from, as well as the stream. It can make a fresh instance when reading.

Constructors​

MemberWhat it is
MethodSyncClass(NetworkEntity entity, EntityMessageType messageType, SerializeMethod<T> method, RecreateArgumentMode recreateArgumentMode = 0)Creates a MethodSyncClass from entity, messageType, method and recreateArgumentMode.

Fields​

2 private and internal fields
MemberWhat it is
private SerializeMethod<T> methodThe serialize method called with the player, stream and value.
private RecreateArgumentMode recreateArgumentModeWhen reading makes a new T: never, always, or only if the value is null (default).

Properties​

MemberWhat it is
override SerializeMethod Handler { get; }The method run when the message is sent or received. It creates Value when reading if the mode says to, then calls your method.

Methods​

1 private and internal method
MemberWhat it is
private void Forward(IPlayer player, Stream stream)Handler that makes a new T when reading (per the recreate mode) and calls the method with it.

Used in​

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