add method to check if an Entity is currently inside the entity system

This commit is contained in:
Gered 2013-11-12 18:19:19 -05:00
parent aa6a5dbb4c
commit 2ba3a1be36

View file

@ -180,6 +180,13 @@ public class EntityManager implements Disposable {
entities.clear();
}
public boolean isValid(Entity entity) {
if (entity == null)
return false;
else
return entities.contains(entity);
}
/*** public Entity Component management ***/
public <T extends Component> T addComponent(Class<T> componentType, Entity entity) {