Midnight Blue Game and Engine
|
Performs logic on an entity. More...
Public Member Functions | |
EntitySystem (params Type[] components) | |
Initializes a new instance of the T:MB2D.EntityComponent.EntitySystem class. Checks if the passed in types are valid components and if not, all components are deregistered leaving a system that knows about nothing and can't operate on any entities. More... | |
void | Run () |
Runs this systems Process() method on all entities More... | |
void | AssociateEntity (Entity entity) |
Associates a new entity with this system. More... | |
void | RemoveAssociation (Entity entity) |
Decouples an association with this system More... | |
Protected Member Functions | |
virtual void | ProcessingLoop () |
Executes Process() on all AssociatedEntities. More... | |
void | Destroy (Entity entity) |
Adds the specific entity to the destroy list to be cleaned up the next time a system is run More... | |
virtual void | PreProcess () |
Used to setup any data needed before processing all entities, such as sorting a list ahead of time More... | |
virtual void | PostProcess () |
Used to cleanup or execute any teardown logic needed More... | |
virtual void | PostAssociate (Entity entity) |
Used to define any logic or extra data needed after an entity is associated with the system. More... | |
abstract void | Process (Entity entity) |
Executes this systems logic on a single entity More... | |
Protected Attributes | |
Dictionary< ulong, Entity > | _idEntityMap |
All GUID's of entities this system knows about More... | |
EntityAssociation | _associationType |
Defines if this system should be Loose or Strict More... | |
Properties | |
List< Entity > | AssociatedEntities [get, set] |
Gets or sets the associated entities list. More... | |
List< Type > | ValidComponents [get] |
Gets the list of components this system is interested in More... | |
ulong | ID [get, set] |
Gets or sets this systems ID mask More... | |
List< Entity > | DestroyList [get] |
Gets the destroy list. More... | |
EntityAssociation | Association [get] |
Gets the systems association level. More... | |
Performs logic on an entity.
|
inline |
Initializes a new instance of the T:MB2D.EntityComponent.EntitySystem class. Checks if the passed in types are valid components and if not, all components are deregistered leaving a system that knows about nothing and can't operate on any entities.
components | Components this system is interested in |
|
inline |
Associates a new entity with this system.
entity | Entity to associate |
|
inlineprotected |
Adds the specific entity to the destroy list to be cleaned up the next time a system is run
entity | Entity to destroy. |
|
inlineprotectedvirtual |
Used to define any logic or extra data needed after an entity is associated with the system.
entity | Entity. |
|
inlineprotectedvirtual |
Used to cleanup or execute any teardown logic needed
|
inlineprotectedvirtual |
Used to setup any data needed before processing all entities, such as sorting a list ahead of time
Reimplemented in MB2D.EntityComponent.CollisionSystem, MidnightBlue.GalaxyRenderSystem, and MB2D.EntityComponent.RenderSystem.
|
protectedpure virtual |
Executes this systems logic on a single entity
entity | Entity to operate on |
Implemented in MB2D.EntityComponent.CollisionSystem, MidnightBlue.GalaxyRenderSystem, MB2D.EntityComponent.RenderSystem, MB2D.Testing.TestSystem2, MB2D.EntityComponent.PhysicsSystem, MB2D.Testing.TestSystem, MidnightBlue.ShipInputSystem, MB2D.EntityComponent.InputSystem, MB2D.EntityComponent.MovementSystem, MB2D.EntityComponent.DepthSystem, and MB2D.Testing.CollisionRenderSystem.
|
inlineprotectedvirtual |
Executes Process() on all AssociatedEntities.
Reimplemented in MB2D.EntityComponent.CollisionSystem.
|
inline |
Decouples an association with this system
entity | Entity to decouple. |
|
inline |
|
protected |
Defines if this system should be Loose or Strict
|
protected |
All GUID's of entities this system knows about
|
getset |
Gets or sets the associated entities list.
The associated entities.
|
get |
Gets the systems association level.
The association level.
|
get |
Gets the destroy list.
The destroy list.
|
getset |
Gets or sets this systems ID mask
The identifier mask.
|
get |
Gets the list of components this system is interested in
The valid components.