Midnight Blue Game and Engine
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
MB2D.EntityComponent.EntitySystem Class Referenceabstract

Performs logic on an entity. More...

Inheritance diagram for MB2D.EntityComponent.EntitySystem:
Inheritance graph
Collaboration diagram for MB2D.EntityComponent.EntitySystem:
Collaboration graph

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< EntityAssociatedEntities [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< EntityDestroyList [get]
 Gets the destroy list. More...
 
EntityAssociation Association [get]
 Gets the systems association level. More...
 

Detailed Description

Performs logic on an entity.

Constructor & Destructor Documentation

§ EntitySystem()

MB2D.EntityComponent.EntitySystem.EntitySystem ( params Type []  components)
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.

Parameters
componentsComponents this system is interested in

Member Function Documentation

§ AssociateEntity()

void MB2D.EntityComponent.EntitySystem.AssociateEntity ( Entity  entity)
inline

Associates a new entity with this system.

Parameters
entityEntity to associate

§ Destroy()

void MB2D.EntityComponent.EntitySystem.Destroy ( Entity  entity)
inlineprotected

Adds the specific entity to the destroy list to be cleaned up the next time a system is run

Parameters
entityEntity to destroy.

§ PostAssociate()

virtual void MB2D.EntityComponent.EntitySystem.PostAssociate ( Entity  entity)
inlineprotectedvirtual

Used to define any logic or extra data needed after an entity is associated with the system.

Parameters
entityEntity.

§ PostProcess()

virtual void MB2D.EntityComponent.EntitySystem.PostProcess ( )
inlineprotectedvirtual

Used to cleanup or execute any teardown logic needed

§ PreProcess()

virtual void MB2D.EntityComponent.EntitySystem.PreProcess ( )
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.

§ Process()

abstract void MB2D.EntityComponent.EntitySystem.Process ( Entity  entity)
protectedpure virtual

§ ProcessingLoop()

virtual void MB2D.EntityComponent.EntitySystem.ProcessingLoop ( )
inlineprotectedvirtual

Executes Process() on all AssociatedEntities.

Reimplemented in MB2D.EntityComponent.CollisionSystem.

§ RemoveAssociation()

void MB2D.EntityComponent.EntitySystem.RemoveAssociation ( Entity  entity)
inline

Decouples an association with this system

Parameters
entityEntity to decouple.

§ Run()

void MB2D.EntityComponent.EntitySystem.Run ( )
inline

Runs this systems Process() method on all entities

Here is the caller graph for this function:

Member Data Documentation

§ _associationType

EntityAssociation MB2D.EntityComponent.EntitySystem._associationType
protected

Defines if this system should be Loose or Strict

§ _idEntityMap

Dictionary<ulong, Entity> MB2D.EntityComponent.EntitySystem._idEntityMap
protected

All GUID's of entities this system knows about

Property Documentation

§ AssociatedEntities

List<Entity> MB2D.EntityComponent.EntitySystem.AssociatedEntities
getset

Gets or sets the associated entities list.

The associated entities.

§ Association

EntityAssociation MB2D.EntityComponent.EntitySystem.Association
get

Gets the systems association level.

The association level.

§ DestroyList

List<Entity> MB2D.EntityComponent.EntitySystem.DestroyList
get

Gets the destroy list.

The destroy list.

§ ID

ulong MB2D.EntityComponent.EntitySystem.ID
getset

Gets or sets this systems ID mask

The identifier mask.

§ ValidComponents

List<Type> MB2D.EntityComponent.EntitySystem.ValidComponents
get

Gets the list of components this system is interested in

The valid components.


The documentation for this class was generated from the following file: