From 7849d1ad3ab95d0b6ffa0534731ec958c1966456 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 27 Oct 2013 15:10:30 -0400 Subject: [PATCH] convenience helper for checking if an entity is inactive I figure this is fine to add since InactiveComponent is a so-called "system" component --- src/com/blarg/gdx/entities/Entity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/blarg/gdx/entities/Entity.java b/src/com/blarg/gdx/entities/Entity.java index 0d77ef8..b6ce4d3 100644 --- a/src/com/blarg/gdx/entities/Entity.java +++ b/src/com/blarg/gdx/entities/Entity.java @@ -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); + } }