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:
parent
873d16a592
commit
7849d1ad3a
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue