Sdk/BaseComponent: Add GetEntity method

This commit is contained in:
Lynix 2017-03-20 07:49:01 +01:00
parent 9341f7e62a
commit 02508fb99d
2 changed files with 10 additions and 1 deletions

View File

@ -29,6 +29,7 @@ namespace Ndk
virtual std::unique_ptr<BaseComponent> Clone() const = 0;
inline const EntityHandle& GetEntity() const;
ComponentIndex GetIndex() const;
inline static ComponentIndex GetMaxComponentIndex();

View File

@ -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;