Mallet Engine
2
Entity-Component based game engine, written in Java.
|
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< Entity > | getEntities () |
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< Entity > | entitiesToAdd = new ArrayList<Entity>() |
final ArrayList< Entity > | cleanup = new ArrayList<Entity>() |
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.
void com.linxonline.mallet.entity.system.EntitySystem.addEntity | ( | final Entity | _entity | ) |
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.
void com.linxonline.mallet.entity.system.EntitySystem.addEntityNow | ( | final Entity | _entity | ) |
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.
void com.linxonline.mallet.entity.system.EntitySystem.cleanupEntities | ( | ) | [protected] |
Returns a list of all entities, including those to be added to the main list.
Implements com.linxonline.mallet.entity.system.EntitySystemInterface.
Entity com.linxonline.mallet.entity.system.EntitySystem.getEntityByName | ( | final String | _name | ) |
SearchInterface com.linxonline.mallet.entity.system.EntitySystem.getSearch | ( | ) |
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.
void com.linxonline.mallet.entity.system.EntitySystem.removeEntity | ( | final Entity | _entity | ) |
void com.linxonline.mallet.entity.system.EntitySystem.toBeAddedEntities | ( | ) | [protected] |
Loop through the entitiesToAdd and hook them up and add them to the entity list.
void com.linxonline.mallet.entity.system.EntitySystem.update | ( | final float | _dt | ) |
final ArrayList<Entity> com.linxonline.mallet.entity.system.EntitySystem.cleanup = new ArrayList<Entity>() [protected] |
EntityUpdateInterface com.linxonline.mallet.entity.system.EntitySystem.entities = new DefaultUpdate() [protected] |
final ArrayList<Entity> com.linxonline.mallet.entity.system.EntitySystem.entitiesToAdd = new ArrayList<Entity>() [protected] |
final Settings com.linxonline.mallet.entity.system.EntitySystem.hashQuery = new Settings() [protected] |
final QuerySystem com.linxonline.mallet.entity.system.EntitySystem.querySystem = new QuerySystem() [protected] |
final HookEntity com.linxonline.mallet.entity.system.EntitySystem.state [protected] |