Skip to main content

IChildSyncable<T>

An interface in Root.Township, the global namespace.

An element in a ChildSyncableCollectionBase that syncs as part of its parent entity rather than as its own entity. The two-type version also saves and loads.

Properties​

MemberWhat it is
NetworkEntity Entity { get; set; }The entity the collection belongs to.
uint Index { get; set; }Position of the element in its collection, used to address it in messages.

Methods​

MemberWhat it is
void CopyFrom(T other)Copies state from another element.
void Initialize(ChildSyncableCollectionBase<T> collection)Called with the owning collection when set up.
void InitializeAsServer(SpawnData spawnData)Server: set-up with the entity's spawn data.
bool IsEqual(T other)True if this matches another element's state.
bool IsNeedingSync()True when the element has changes to send.
void Sync(IPlayer player, Stream stream)Reads or writes the element's state on a stream.