com.artemis
Class EntityManager

java.lang.Object
  extended by com.artemis.Manager
      extended by com.artemis.EntityManager
All Implemented Interfaces:
EntityObserver

public class EntityManager
extends Manager


Field Summary
 
Fields inherited from class com.artemis.Manager
world
 
Constructor Summary
EntityManager()
           
 
Method Summary
 void added(Entity e)
           
protected  Entity createEntityInstance()
           
 void deleted(Entity e)
           
 void disabled(Entity e)
           
 void enabled(Entity e)
           
 int getActiveEntityCount()
          Get how many entities are active in this world.
protected  Entity getEntity(int entityId)
          Get a entity with this id.
 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()
           
 boolean isActive(int entityId)
          Check if this entity is active.
 boolean isEnabled(int entityId)
          Check if the specified entityId is enabled.
 
Methods inherited from class com.artemis.Manager
changed, getWorld, setWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityManager

public EntityManager()
Method Detail

initialize

protected void initialize()
Specified by:
initialize in class Manager

createEntityInstance

protected Entity createEntityInstance()

added

public void added(Entity e)
Specified by:
added in interface EntityObserver
Overrides:
added in class Manager

enabled

public void enabled(Entity e)
Specified by:
enabled in interface EntityObserver
Overrides:
enabled in class Manager

disabled

public void disabled(Entity e)
Specified by:
disabled in interface EntityObserver
Overrides:
disabled in class Manager

deleted

public void deleted(Entity e)
Specified by:
deleted in interface EntityObserver
Overrides:
deleted in class Manager

isActive

public boolean isActive(int entityId)
Check if this entity is active. Active means the entity is being actively processed.

Parameters:
entityId -
Returns:
true if active, false if not.

isEnabled

public boolean isEnabled(int entityId)
Check if the specified entityId is enabled.

Parameters:
entityId -
Returns:
true if the entity is enabled, false if it is disabled.

getEntity

protected Entity getEntity(int entityId)
Get a entity with this id.

Parameters:
entityId -
Returns:
the entity

getActiveEntityCount

public int getActiveEntityCount()
Get how many entities are active in this world.

Returns:
how many entities are currently active.

getTotalCreated

public long getTotalCreated()
Get how many entities have been created in the world since start. Note: A created entity may not have been added to the world, thus created count is always equal or larger than added count.

Returns:
how many entities have been created since start.

getTotalAdded

public long getTotalAdded()
Get how many entities have been added to the world since start.

Returns:
how many entities have been added.

getTotalDeleted

public long getTotalDeleted()
Get how many entities have been deleted from the world since start.

Returns:
how many entities have been deleted since start.


Copyright © 2012 Gamadu. All Rights Reserved.