Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    EntityProcessor<TComponent, TData> Class

    Namespace: Stride.Engine
    Assembly: Stride.Engine.dll

    Helper class for EntityProcessor, that will keep track of Entity matching certain EntityComponent requirements.

    System.Object → EntityProcessor → EntityProcessor<TComponent, TData>
    Derived from EntityProcessor<TComponent, TData>: AnimationProcessor AudioEmitterProcessor EntityProcessor<TComponent> InstancingProcessor LightShaftProcessor ModelTransformProcessor NavigationProcessor ParticleSystemRenderProcessor PhysicsProcessor BackgroundRenderProcessor LightProcessor ModelRenderProcessor UIRenderProcessor

    public abstract class EntityProcessor<TComponent, TData> : EntityProcessor where TComponent : EntityComponent where TData : class
    Type Parameters
    Name Description
    TComponent

    The main type of the component this processor is looking for.

    TData

    The type of the associated data.

    Remarks

    Additional precomputed data will be stored alongside the Entity to offer faster accesses and iterations.

    Name Description
    Constructors
    EntityProcessor(Type[])
    Fields
    ComponentDatas
    Methods
    GenerateComponentData(Entity, TComponent)

    Generates associated data to the given entity.

    IsAssociatedDataValid(Entity, TComponent, TData)

    Checks if the current associated data is valid, or if readding the entity is required.

    OnEntityComponentAdding(Entity, TComponent, TData)

    Run when a matching entity is added to this entity processor.

    OnEntityComponentRemoved(Entity, TComponent, TData)

    Run when a matching entity is removed from this entity processor.

    OnSystemAdd()

    Run when this EntityProcessor is added to an EntityManager.

    OnSystemRemove()

    Run when this EntityProcessor is removed from an EntityManager.

    ProcessEntityComponent(Entity, EntityComponent, Boolean)

    Checks if Entity needs to be either added or removed.

    RemoveAllEntities()

    Should be called prior removal, it will unregister all entities.

    | Improve this Doc View Source

    Constructors


    EntityProcessor(Type[])

    protected EntityProcessor(params Type[] requiredAdditionalTypes)
    Parameters
    Type Name Description
    System.Type[] requiredAdditionalTypes
    | Improve this Doc View Source

    Fields


    ComponentDatas

    protected readonly Dictionary<TComponent, TData> ComponentDatas
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<TComponent, TData>
    | Improve this Doc View Source

    Methods


    GenerateComponentData(Entity, TComponent)

    Generates associated data to the given entity.

    protected abstract TData GenerateComponentData(Entity entity, TComponent component)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    TComponent component
    Returns
    Type Description
    TData

    The associated data.


    IsAssociatedDataValid(Entity, TComponent, TData)

    Checks if the current associated data is valid, or if readding the entity is required.

    protected virtual bool IsAssociatedDataValid(Entity entity, TComponent component, TData associatedData)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    TComponent component
    TData associatedData

    The associated data.

    Returns
    Type Description
    System.Boolean

    True if the change in associated data requires the entity to be readded, false otherwise.


    OnEntityComponentAdding(Entity, TComponent, TData)

    Run when a matching entity is added to this entity processor.

    protected virtual void OnEntityComponentAdding(Entity entity, TComponent component, TData data)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    TComponent component
    TData data

    The associated data.


    OnEntityComponentRemoved(Entity, TComponent, TData)

    Run when a matching entity is removed from this entity processor.

    protected virtual void OnEntityComponentRemoved(Entity entity, TComponent component, TData data)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    TComponent component
    TData data

    The associated data.


    OnSystemAdd()

    Run when this EntityProcessor is added to an EntityManager.

    protected override void OnSystemAdd()
    Overrides
    EntityProcessor.OnSystemAdd()

    OnSystemRemove()

    Run when this EntityProcessor is removed from an EntityManager.

    protected override void OnSystemRemove()
    Overrides
    EntityProcessor.OnSystemRemove()

    ProcessEntityComponent(Entity, EntityComponent, Boolean)

    Checks if Entity needs to be either added or removed.

    protected override void ProcessEntityComponent(Entity entity, EntityComponent entityComponentArg, bool forceRemove)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    EntityComponent entityComponentArg
    System.Boolean forceRemove
    Overrides
    EntityProcessor.ProcessEntityComponent(Entity, EntityComponent, Boolean)

    RemoveAllEntities()

    Should be called prior removal, it will unregister all entities.

    protected override void RemoveAllEntities()
    Overrides
    EntityProcessor.RemoveAllEntities()

    Inherited Members

    EntityProcessor.Tags
    EntityProcessor.UpdateProfilingState
    EntityProcessor.DrawProfilingState
    EntityProcessor.Enabled
    EntityProcessor.MainComponentType
    EntityProcessor.RequiredTypes
    EntityProcessor.HasRequiredComponents
    EntityProcessor.Order
    EntityProcessor.EntityManager
    EntityProcessor.Services
    EntityProcessor.Update(GameTime)
    EntityProcessor.Draw(RenderContext)
    EntityProcessor.InternalAddEntity(Entity)
    EntityProcessor.InternalRemoveEntity(Entity, Boolean)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation