From 02508fb99d71c6fb808e3fa51772bd9ff058e974 Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 20 Mar 2017 07:49:01 +0100 Subject: [PATCH] Sdk/BaseComponent: Add GetEntity method --- SDK/include/NDK/BaseComponent.hpp | 1 + SDK/include/NDK/BaseComponent.inl | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/SDK/include/NDK/BaseComponent.hpp b/SDK/include/NDK/BaseComponent.hpp index e21a1e38f..d9fdcba45 100644 --- a/SDK/include/NDK/BaseComponent.hpp +++ b/SDK/include/NDK/BaseComponent.hpp @@ -29,6 +29,7 @@ namespace Ndk virtual std::unique_ptr Clone() const = 0; + inline const EntityHandle& GetEntity() const; ComponentIndex GetIndex() const; inline static ComponentIndex GetMaxComponentIndex(); diff --git a/SDK/include/NDK/BaseComponent.inl b/SDK/include/NDK/BaseComponent.inl index 7abade990..0596eb589 100644 --- a/SDK/include/NDK/BaseComponent.inl +++ b/SDK/include/NDK/BaseComponent.inl @@ -19,11 +19,19 @@ namespace Ndk { } + /*! + * \brief Gets the entity owning this component + * \return A handle to the entity owning this component, may be invalid if no entity owns it. + */ + inline const EntityHandle& BaseComponent::GetEntity() const + { + return m_entity; + } + /*! * \brief Gets the index of the component * \return Index of the component */ - inline ComponentIndex BaseComponent::GetIndex() const { return m_componentIndex;