add method to check if an Entity is currently inside the entity system
This commit is contained in:
parent
aa6a5dbb4c
commit
2ba3a1be36
|
@ -180,6 +180,13 @@ public class EntityManager implements Disposable {
|
||||||
entities.clear();
|
entities.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValid(Entity entity) {
|
||||||
|
if (entity == null)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return entities.contains(entity);
|
||||||
|
}
|
||||||
|
|
||||||
/*** public Entity Component management ***/
|
/*** public Entity Component management ***/
|
||||||
|
|
||||||
public <T extends Component> T addComponent(Class<T> componentType, Entity entity) {
|
public <T extends Component> T addComponent(Class<T> componentType, Entity entity) {
|
||||||
|
|
Loading…
Reference in a new issue