From fa2d7ee95b7218efd8244923786129588fee8e75 Mon Sep 17 00:00:00 2001 From: Benjamin Kloster Date: Sat, 18 May 2013 12:02:07 +0200 Subject: [PATCH] Add id() method to Entity class Mostly for internal use. May be exposed to scripts at a later date. --- src/engine/entity.cpp | 6 ++++++ src/engine/entity.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/engine/entity.cpp b/src/engine/entity.cpp index d776d1c028a..21de4c539ae 100644 --- a/src/engine/entity.cpp +++ b/src/engine/entity.cpp @@ -192,6 +192,12 @@ Entity::hasComponent( } +EntityId +Entity::id() const { + return m_impl->m_id; +} + + void Entity::removeComponent( Component::TypeId typeId diff --git a/src/engine/entity.h b/src/engine/entity.h index 34724b2a680..cc67ccf97e8 100644 --- a/src/engine/entity.h +++ b/src/engine/entity.h @@ -247,6 +247,12 @@ class Entity { const std::string& typeName ); + /** + * @brief The entity's id + */ + EntityId + id() const; + /** * @brief Removes a component by type id *