Class InternalEntity
- Namespace
- LiteEntitySystem.Internal
- Assembly
- LiteEntitySystem.dll
public abstract class InternalEntity : InternalBaseClass, IComparable<InternalEntity>
- Inheritance
-
objectInternalEntity
- 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
EntityManager
Entity manager
public readonly EntityManager EntityManager
Field Value
Id
Entity instance id
public readonly ushort Id
Field Value
Version
Entity version (for id reuse)
public readonly byte Version
Field Value
Properties
ClientManager
ClientEntityManager that available only on client. Will throw exception if called on server
public ClientEntityManager ClientManager { get; }
Property Value
IsClient
Is entity on server
public bool IsClient { get; }
Property Value
IsConstructed
Is entity constructed (OnConstruct called)
public bool IsConstructed { get; }
Property Value
IsDestroyed
Is entity is destroyed
public bool IsDestroyed { get; }
Property Value
IsLocal
Is locally created entity
public bool IsLocal { get; }
Property Value
IsLocalControlled
Is entity local controlled
public bool IsLocalControlled { get; }
Property Value
IsRemoteControlled
Is entity remote controlled
public bool IsRemoteControlled { get; }
Property Value
IsRemoved
Is entity released and not used after destroy.
public bool IsRemoved { get; }
Property Value
IsServer
Is entity on server
public bool IsServer { get; }
Property Value
IsServerControlled
Is entity is controlled by server
public bool IsServerControlled { get; }
Property Value
IsSingleton
Is entity based on SingletonEntityLogic
public bool IsSingleton { get; }
Property Value
OwnerId
Owner player id ServerPlayerId - 0 Singletons always controlled by server
public byte OwnerId { get; }
Property Value
ServerManager
ServerEntityManager that available only on server. Will throw exception if called on client
public ServerEntityManager ServerManager { get; }
Property Value
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
InternalEntityAn 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:
ValueMeaning
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
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()