convenience helper for checking if an entity is inactive

I figure this is fine to add since InactiveComponent is a so-called
"system" component
This commit is contained in:
Gered 2013-10-27 15:10:30 -04:00
parent 873d16a592
commit 7849d1ad3a

View file

@ -1,6 +1,7 @@
package com.blarg.gdx.entities;
import com.blarg.gdx.entities.systemcomponents.EntityPresetComponent;
import com.blarg.gdx.entities.systemcomponents.InactiveComponent;
// Yes, this class SHOULD be marked final. No, you ARE wrong for wanting to subclass this.
// There IS a better way to do what you were thinking of doing that DOESN'T involve
@ -48,4 +49,8 @@ public final class Entity {
else
return null;
}
public boolean isInactive() {
return entityManager.hasComponent(InactiveComponent.class, this);
}
}