diff --git a/src/com/blarg/gdx/entities/Entity.java b/src/com/blarg/gdx/entities/Entity.java index 3f57b5f..0d77ef8 100644 --- a/src/com/blarg/gdx/entities/Entity.java +++ b/src/com/blarg/gdx/entities/Entity.java @@ -1,5 +1,7 @@ package com.blarg.gdx.entities; +import com.blarg.gdx.entities.systemcomponents.EntityPresetComponent; + // 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 // subclassing Entity! @@ -34,4 +36,16 @@ public final class Entity { public boolean has(Class componentType) { return entityManager.hasComponent(componentType, this); } + + public boolean wasCreatedViaPreset() { + return entityManager.hasComponent(EntityPresetComponent.class, this); + } + + public Class getPresetUsedToCreate() { + EntityPresetComponent presetComponent = entityManager.getComponent(EntityPresetComponent.class, this); + if (presetComponent != null) + return presetComponent.presetType; + else + return null; + } }