Package com.tenio.engine.ecs.base
Interface IContext<TEntity extends IEntity>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TEntity
createEntity()
Create new entityvoid
destroyAllEntities()
Remove all context's entitiesvoid
destroyEntity(TEntity entity)
Remove this entity from the current contextContextInfo
getContextInfo()
Retrieves the context informationint
getEntitesCount()
Retrieves the number of entitiesjava.util.Map<java.lang.String,TEntity>
getEntities()
Retrieves all entities of the current contextTEntity
getEntity(java.lang.String entityId)
Retrieves an entity by entity idboolean
hasEntity(TEntity entity)
Check if the entity is existed by entity idvoid
reset()
Reset the current context
-
-
-
Method Detail
-
createEntity
TEntity createEntity()
Create new entity- Returns:
- the entity by the corresponding entity template
-
getEntity
TEntity getEntity(java.lang.String entityId)
Retrieves an entity by entity id- Parameters:
entityId
- the entity id- Returns:
- the corresponding entity
-
hasEntity
boolean hasEntity(TEntity entity)
Check if the entity is existed by entity id- Parameters:
entity
- the entity- Returns:
- true if this entity is existed in the current context, false otherwise
-
destroyEntity
void destroyEntity(TEntity entity)
Remove this entity from the current context- Parameters:
entity
- the corresponding entity
-
getEntities
java.util.Map<java.lang.String,TEntity> getEntities()
Retrieves all entities of the current context- Returns:
- the map of entities
-
getContextInfo
ContextInfo getContextInfo()
Retrieves the context information- Returns:
- see
ContextInfo
-
getEntitesCount
int getEntitesCount()
Retrieves the number of entities- Returns:
- the entities count
-
destroyAllEntities
void destroyAllEntities()
Remove all context's entities
-
reset
void reset()
Reset the current context
-
-