Mallet Engine  2
Entity-Component based game engine, written in Java.
 All Classes Namespaces Files Functions Variables
Public Member Functions | Protected Member Functions | Protected Attributes
com.linxonline.mallet.entity.system.EntitySystem Class Reference
Inheritance diagram for com.linxonline.mallet.entity.system.EntitySystem:
Inheritance graph
[legend]
Collaboration diagram for com.linxonline.mallet.entity.system.EntitySystem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EntitySystem (final HookEntity _state)
void addEntity (final Entity _entity)
void addEntityNow (final Entity _entity)
void removeEntity (final Entity _entity)
void addQuery (final QueryInterface _interface)
void update (final float _dt)
void clear ()
SearchInterface getSearch ()
ArrayList< EntitygetEntities ()
Entity getEntityByName (final String _name)

Protected Member Functions

void toBeAddedEntities ()
void cleanupEntities ()

Protected Attributes

final HookEntity state
final QuerySystem querySystem = new QuerySystem()
final Settings hashQuery = new Settings()
EntityUpdateInterface entities = new DefaultUpdate()
final ArrayList< EntityentitiesToAdd = new ArrayList<Entity>()
final ArrayList< Entitycleanup = new ArrayList<Entity>()

Detailed Description

The EntitySystem stores and updates Entities that are being used in the current running Game State. Use the QuerySystem to effeciently search for entities. You can also extends the EntitySystem so it updates certain entities before others, by default it simply stores them all in a massive ArrayList.


Constructor & Destructor Documentation


Member Function Documentation

Add the Entity to the entity list at the next appropriate moment. This prevents an Entity from being added during the update of the EntitySystem.

Implements com.linxonline.mallet.entity.system.EntitySystemInterface.

Add the Entity directly to the entity list. NOTE: This should be used carefully.

Implements com.linxonline.mallet.entity.system.EntitySystemInterface.

void com.linxonline.mallet.entity.system.EntitySystem.addQuery ( final QueryInterface  _interface)

Add a QueryInterface to the QuerySystem. All entities are added to this new QueryInterface

Implements com.linxonline.mallet.entity.system.EntitySystemInterface.

Returns a list of all entities, including those to be added to the main list.

Implements com.linxonline.mallet.entity.system.EntitySystemInterface.

Returns a SearchInterface The Entity System returns an Interface of the QuerySystem to allow other systems to search the entities effectively.

Implements com.linxonline.mallet.entity.system.EntitySystemInterface.

Loop through the entitiesToAdd and hook them up and add them to the entity list.


Member Data Documentation

final ArrayList<Entity> com.linxonline.mallet.entity.system.EntitySystem.cleanup = new ArrayList<Entity>() [protected]
final ArrayList<Entity> com.linxonline.mallet.entity.system.EntitySystem.entitiesToAdd = new ArrayList<Entity>() [protected]
final QuerySystem com.linxonline.mallet.entity.system.EntitySystem.querySystem = new QuerySystem() [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables