Bandidos
|
Public Member Functions | |
EntitySystem () | |
void | updateEntities (float dt) |
void | renderEntities (RenderComponents gameRenderComponents) |
void | destroyAllEntities () |
void | destroyAllEntitiesImmediately () |
boolean | isEntityInDestroyStack (BaseEntity entity) |
void | destroyEntity (BaseEntity entity) |
void | destroyEntityImmediately (BaseEntity entity) |
void | onReceiveEvent (Event event) |
ArrayList< BaseEntity > | getAllEntities () |
BaseEntity | getEntityByTag (String tag) |
BaseEntity [] | getEntitiesByTag (String tag) |
Static Public Member Functions | |
static EntitySystem | getInstance () |
This is a singleton class which handles all the entity handling. By its instance you can find active entities by tags and types. IMPORTANT: This class must be updated in order for all the entities to update and their components.
com.mygdx.game.engine.entities.EntitySystem.EntitySystem | ( | ) |
void com.mygdx.game.engine.entities.EntitySystem.destroyAllEntities | ( | ) |
Destroys all currently active entities.
void com.mygdx.game.engine.entities.EntitySystem.destroyAllEntitiesImmediately | ( | ) |
Destroys all currently active entities this exact frame.
void com.mygdx.game.engine.entities.EntitySystem.destroyEntity | ( | BaseEntity | entity | ) |
Destroys the given entity.
entity | to destroy |
void com.mygdx.game.engine.entities.EntitySystem.destroyEntityImmediately | ( | BaseEntity | entity | ) |
Destroys the given entity this exact frame.
ArrayList<BaseEntity> com.mygdx.game.engine.entities.EntitySystem.getAllEntities | ( | ) |
Gets and returns all the existing entities
BaseEntity [] com.mygdx.game.engine.entities.EntitySystem.getEntitiesByTag | ( | String | tag | ) |
Returns all entities active with the given tag
tag | which all the returning entities must have |
BaseEntity com.mygdx.game.engine.entities.EntitySystem.getEntityByTag | ( | String | tag | ) |
Returns the first entity active with the given tag
tag | which the entity must have |
|
static |
boolean com.mygdx.game.engine.entities.EntitySystem.isEntityInDestroyStack | ( | BaseEntity | entity | ) |
Checks of the entity is ready for destruction next frame.
entity | to check if its ready for destruction next frame. |
void com.mygdx.game.engine.entities.EntitySystem.onReceiveEvent | ( | Event | event | ) |
This will be triggered when an event has been fired of type which this implementing class was listening to.
event | which has one of the event types which is listened to. |
Implements com.mygdx.game.engine.events.IEventReceiver.
void com.mygdx.game.engine.entities.EntitySystem.renderEntities | ( | RenderComponents | gameRenderComponents | ) |
MUST BE CALLED TO RENDER ALL ENTITIES Renders all the entities with the 'RenderComponent' which are active.
gameRenderComponents | which are used to render the entity |
void com.mygdx.game.engine.entities.EntitySystem.updateEntities | ( | float | dt | ) |
MUST BE CALLED TO UPDATE ALL ENTITIES Without this being called in the loop the system does not work.
dt | is the delta time between this frame and the last. |