Table of Contents

Class EntityProcessor

Namespace
Stride.Engine
Assembly
Stride.Engine.dll

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 Type

Type 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

ProfilingState

Tags

Tags associated to this entity processor

public PropertyContainer Tags

Field Value

PropertyContainer

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

ProfilingState

Properties

Enabled

Gets or sets a value indicating whether this EntityProcessor is enabled.

public bool Enabled { get; set; }

Property Value

bool

EntityManager

Gets the current entity manager.

public EntityManager EntityManager { get; }

Property Value

EntityManager

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

bool

MainComponentType

Gets the primary component type handled by this processor

public Type MainComponentType { get; }

Property Value

Type

Order

Gets or sets the order of this processor.

public int Order { get; protected set; }

Property Value

int

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

IServiceRegistry

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 Entity

The 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

entity Entity

The entity.

removeParent bool

Indicate if entity should be removed from its parent

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 Entity

The entity.

entityComponent EntityComponent
forceRemove 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