public class EntityManager extends Manager
| Modifier | Constructor and Description |
|---|---|
protected |
EntityManager(int initialContainerSize)
Creates a new EntityManager Instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
added(Entity e)
Adds the entity to this manager.
|
protected void |
clean() |
protected Entity |
createEntityInstance()
Create a new entity.
|
protected Entity |
createEntityInstance(ArchetypeBuilder.Archetype archetype)
Create a new entity based on the supplied archetype.
|
void |
deleted(Entity e)
Removes the entity from the manager, freeing it's id for new entities.
|
void |
disabled(Entity e)
Sets the entity as disabled in the manager.
|
void |
enabled(Entity e)
Deprecated.
create your own components to track state.
|
int |
getActiveEntityCount()
Get how many entities are active in this world.
|
protected Entity |
getEntity(int entityId)
Get a entity with this id.
|
protected int |
getIdentity(Entity e) |
long |
getTotalAdded()
Get how many entities have been added to the world since start.
|
long |
getTotalCreated()
Get how many entities have been created in the world since start.
|
long |
getTotalDeleted()
Get how many entities have been deleted from the world since start.
|
protected void |
initialize()
Called when the world initializes.
|
boolean |
isActive(int entityId)
Check if this entity is active.
|
boolean |
isEnabled(int entityId)
Deprecated.
create your own components to track state.
|
protected EntityManager(int initialContainerSize)
protected void initialize()
ManagerOverride to implement custom behavior at initialization.
initialize in class Managerprotected Entity createEntityInstance()
protected Entity createEntityInstance(ArchetypeBuilder.Archetype archetype)
public void added(Entity e)
Called by the world when an entity is added.
added in interface EntityObserveradded in class Managere - the entity to add@Deprecated public void enabled(Entity e)
enabled in interface EntityObserverenabled in class Managere - the entity to (re)enablepublic void disabled(Entity e)
disabled in interface EntityObserverdisabled in class Managere - the entity to disablepublic void deleted(Entity e)
deleted in interface EntityObserverdeleted in class Managere - the entity to removepublic boolean isActive(int entityId)
Active means the entity is being actively processed.
entityId - the entities id@Deprecated public boolean isEnabled(int entityId)
entityId - the entities idprotected Entity getEntity(int entityId)
entityId - the entities idpublic int getActiveEntityCount()
public long getTotalCreated()
Note: A created entity may not have been added to the world, thus created count is always equal or larger than added count.
public long getTotalAdded()
public long getTotalDeleted()
protected void clean()
protected int getIdentity(Entity e)
Copyright © 2014. All Rights Reserved.