Table of Contents

Class InternalEntity

Namespace
LiteEntitySystem.Internal
Assembly
LiteEntitySystem.dll
public abstract class InternalEntity : InternalBaseClass, IComparable<InternalEntity>
Inheritance
object
InternalEntity
Implements
Derived
Inherited Members

Constructors

InternalEntity(EntityParams)

protected InternalEntity(EntityParams entityParams)

Parameters

entityParams EntityParams

Fields

ClassId

Entity class id

public readonly ushort ClassId

Field Value

ushort

EntityManager

Entity manager

public readonly EntityManager EntityManager

Field Value

EntityManager

Id

Entity instance id

public readonly ushort Id

Field Value

ushort

Version

Entity version (for id reuse)

public readonly byte Version

Field Value

byte

Properties

ClientManager

ClientEntityManager that available only on client. Will throw exception if called on server

public ClientEntityManager ClientManager { get; }

Property Value

ClientEntityManager

IsClient

Is entity on server

public bool IsClient { get; }

Property Value

bool

IsConstructed

Is entity constructed (OnConstruct called)

public bool IsConstructed { get; }

Property Value

bool

IsDestroyed

Is entity is destroyed

public bool IsDestroyed { get; }

Property Value

bool

IsLocal

Is locally created entity

public bool IsLocal { get; }

Property Value

bool

IsLocalControlled

Is entity local controlled

public bool IsLocalControlled { get; }

Property Value

bool

IsRemoteControlled

Is entity remote controlled

public bool IsRemoteControlled { get; }

Property Value

bool

IsRemoved

Is entity released and not used after destroy.

public bool IsRemoved { get; }

Property Value

bool

IsServer

Is entity on server

public bool IsServer { get; }

Property Value

bool

IsServerControlled

Is entity is controlled by server

public bool IsServerControlled { get; }

Property Value

bool

IsSingleton

Is entity based on SingletonEntityLogic

public bool IsSingleton { get; }

Property Value

bool

OwnerId

Owner player id ServerPlayerId - 0 Singletons always controlled by server

public byte OwnerId { get; }

Property Value

byte

ServerManager

ServerEntityManager that available only on server. Will throw exception if called on client

public ServerEntityManager ServerManager { get; }

Property Value

ServerEntityManager

Methods

CompareTo(InternalEntity)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(InternalEntity other)

Parameters

other InternalEntity

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in the sort order.

Destroy()

Destroy entity

public void Destroy()

ExecuteRPC(in RemoteCall)

protected void ExecuteRPC(in RemoteCall rpc)

Parameters

rpc RemoteCall

ExecuteRPC<T>(in RemoteCallSerializable<T>, T)

protected void ExecuteRPC<T>(in RemoteCallSerializable<T> rpc, T value) where T : struct, ISpanSerializable

Parameters

rpc RemoteCallSerializable<T>
value T

Type Parameters

T

ExecuteRPC<T>(in RemoteCallSpan<T>, ReadOnlySpan<T>)

protected void ExecuteRPC<T>(in RemoteCallSpan<T> rpc, ReadOnlySpan<T> value) where T : unmanaged

Parameters

rpc RemoteCallSpan<T>
value ReadOnlySpan<T>

Type Parameters

T

ExecuteRPC<T>(in RemoteCall<T>, T)

protected void ExecuteRPC<T>(in RemoteCall<T> rpc, T value) where T : unmanaged

Parameters

rpc RemoteCall<T>
value T

Type Parameters

T

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

OnBeforeRollback()

Called at rollback begin before all values reset to first frame in rollback queue.

protected virtual void OnBeforeRollback()

OnConstructed()

Called when entity constructed

protected virtual void OnConstructed()

OnDestroy()

Event called on entity destroy

protected virtual void OnDestroy()

OnLateConstructed()

Called when entity constructed but at end of frame

protected virtual void OnLateConstructed()

OnRollback()

Called at rollback begin after all values reset to first frame in rollback queue.

protected virtual void OnRollback()

RegisterRPC(ref RPCRegistrator)

Method for registering RPCs and OnChange notifications

protected virtual void RegisterRPC(ref RPCRegistrator r)

Parameters

r RPCRegistrator

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Update()

Fixed update. Called if entity has attribute EntityFlagsAttribute and flag Updateable

protected virtual void Update()

VisualUpdate()

Called only on Update() and if entity has attribute EntityFlagsAttribute and flag Updateable

protected virtual void VisualUpdate()