Class EntityProcessor
Entity processor, triggered on various EntityManager events such as Entity and Component additions and removals.
public abstract class EntityProcessor
- Inheritance
-
EntityProcessor
- Derived
Constructors
EntityProcessor(Type, Type[])
Initializes a new instance of the EntityProcessor class.
protected EntityProcessor(Type mainComponentType, Type[] additionalTypes)
Parameters
mainComponentType
TypeType of the main component.
additionalTypes
Type[]The additional types required by this processor.
Exceptions
- ArgumentNullException
If parameteters are null
- ArgumentException
If a type does not inherit from EntityComponent
Fields
DrawProfilingState
Draw Profiling state of this entity processor for the current frame. Pay attention this is a struct, use directly. Useful to add custom Mark events into processors
public ProfilingState DrawProfilingState
Field Value
Tags
Tags associated to this entity processor
public PropertyContainer Tags
Field Value
UpdateProfilingState
Update Profiling state of this entity processor for the current frame. Pay attention this is a struct, use directly. Useful to add custom Mark events into processors
public ProfilingState UpdateProfilingState
Field Value
Properties
Enabled
Gets or sets a value indicating whether this EntityProcessor is enabled.
public bool Enabled { get; set; }
Property Value
EntityManager
Gets the current entity manager.
public EntityManager EntityManager { get; }
Property Value
HasRequiredComponents
Gets a value indicating whether this processor is requiring some components to be present in addition to the main component of MainComponentType.
public bool HasRequiredComponents { get; }
Property Value
MainComponentType
Gets the primary component type handled by this processor
public Type MainComponentType { get; }
Property Value
Order
Gets or sets the order of this processor.
public int Order { get; protected set; }
Property Value
RequiredTypes
Gets the required components for an entity to be added to this entity processor.
public TypeInfo[] RequiredTypes { get; }
Property Value
- TypeInfo[]
Services
Gets the services.
public IServiceRegistry Services { get; }
Property Value
Methods
Draw(RenderContext)
Performs work related to this processor.
public virtual void Draw(RenderContext context)
Parameters
context
RenderContext
InternalAddEntity(Entity)
Adds the entity to the internal list of the EntityManager. Exposed for inheriting class that has no access to SceneInstance as internal.
protected void InternalAddEntity(Entity entity)
Parameters
entity
EntityThe entity.
InternalRemoveEntity(Entity, bool)
Removes the entity to the internal list of the EntityManager. Exposed for inheriting class that has no access to SceneInstance as internal.
protected void InternalRemoveEntity(Entity entity, bool removeParent)
Parameters
OnSystemAdd()
Run when this EntityProcessor is added to an EntityManager.
protected abstract void OnSystemAdd()
OnSystemRemove()
Run when this EntityProcessor is removed from an EntityManager.
protected abstract void OnSystemRemove()
ProcessEntityComponent(Entity, EntityComponent, bool)
Checks if Entity needs to be either added or removed.
protected abstract void ProcessEntityComponent(Entity entity, EntityComponent entityComponent, bool forceRemove)
Parameters
entity
EntityThe entity.
entityComponent
EntityComponentforceRemove
bool
RemoveAllEntities()
Should be called prior removal, it will unregister all entities.
protected abstract void RemoveAllEntities()
Update(GameTime)
Performs work related to this processor.
public virtual void Update(GameTime time)
Parameters
time
GameTime