Class EntityLogic
Base class for simple (not controlled by controller) entity
Implements
Inherited Members
Namespace: LiteEntitySystem
Assembly: LiteEntitySystem.dll
Syntax
public abstract class EntityLogic : InternalEntity, IComparable<InternalEntity>
Constructors
EntityLogic(EntityParams)
Declaration
protected EntityLogic(EntityParams entityParams)
Parameters
Type | Name | Description |
---|---|---|
EntityParams | entityParams |
Fields
Childs
Child entities (can be used for transforms or as components)
Declaration
public readonly HashSet<EntityLogic> Childs
Field Value
Type | Description |
---|---|
HashSet<EntityLogic> |
Properties
HasLagCompensation
Declaration
public bool HasLagCompensation { get; }
Property Value
Type | Description |
---|---|
bool |
OwnerId
Owner player id
Declaration
public byte OwnerId { get; }
Property Value
Type | Description |
---|---|
byte |
ParentId
Declaration
public EntitySharedReference ParentId { get; }
Property Value
Type | Description |
---|---|
EntitySharedReference |
SharedReference
Declaration
public EntitySharedReference SharedReference { get; }
Property Value
Type | Description |
---|---|
EntitySharedReference |
Methods
AddPredictedEntity<T>(Action<T>)
Create predicted entity (like projectile) that will be replaced by server entity if prediction is successful
Declaration
public T AddPredictedEntity<T>(Action<T> initMethod = null) where T : EntityLogic
Parameters
Type | Name | Description |
---|---|---|
Action<T> | initMethod | Method that will be called after entity constructed |
Returns
Type | Description |
---|---|
T | Created predicted local entity |
Type Parameters
Name | Description |
---|---|
T | Entity type |
DisableLagCompensationForOwner()
Disable lag compensation for player that owns this entity
Declaration
public void DisableLagCompensationForOwner()
EnableLagCompensationForOwner()
Enable lag compensation for player that owns this entity
Declaration
public void EnableLagCompensationForOwner()
GetFrameSeed()
Declaration
public int GetFrameSeed()
Returns
Type | Description |
---|---|
int |
GetParent<T>()
Get parent entity
Declaration
public T GetParent<T>() where T : EntityLogic
Returns
Type | Description |
---|---|
T | parent entity |
Type Parameters
Name | Description |
---|---|
T | Type of entity |
OnLagCompensationEnd()
Called when lag compensation ended for this entity
Declaration
protected virtual void OnLagCompensationEnd()
OnLagCompensationStart()
Called when lag compensation was started for this entity
Declaration
protected virtual void OnLagCompensationStart()
RegisterRPC(ref RPCRegistrator)
Method for registering RPCs and OnChange notifications
Declaration
protected override void RegisterRPC(ref RPCRegistrator r)
Parameters
Type | Name | Description |
---|---|---|
RPCRegistrator | r |
Overrides
SetParent(EntityLogic)
Set parent entity
Declaration
public void SetParent(EntityLogic parentEntity)
Parameters
Type | Name | Description |
---|---|---|
EntityLogic | parentEntity | parent entity |