8#ifndef ECS__I_ENTITY_H__
9#define ECS__I_ENTITY_H__
56 std::shared_lock<std::shared_mutex> r_lock(s_ComponentManagerLock);
57 return ECS::GetComponent<T>( this->m_ComponentManagerInstance, this->m_EntityID );
60 template<
class T,
class ...P>
63 std::scoped_lock<std::shared_mutex > r_lock(s_ComponentManagerLock);
64 return ECS::AddComponent<T>( this->m_ComponentManagerInstance, this->m_EntityID, std::forward<P>( param )... );
70 std::scoped_lock<std::shared_mutex> r_lock(s_ComponentManagerLock);
71 ECS::RemoveComponent<T>( this->m_ComponentManagerInstance, this->m_EntityID );
74 void RemoveAllComponents();
89 void SetActive(
bool active);
91 inline bool IsActive()
const {
return this->m_Active; }
#define DECLARE_STATIC_LOGGER
ComponentManager * m_ComponentManagerInstance
bool operator==(const IEntity *rhs) const
bool operator!=(const IEntity &rhs) const
DECLARE_STATIC_LOGGER EntityId m_EntityID
bool operator!=(const IEntity *rhs) const
static std::shared_mutex s_ComponentManagerLock
bool operator==(const IEntity &rhs) const
T * AddComponent(P &&... param)
EntityId GetEntityID() const
virtual EntityTypeId GetStaticEntityTypeID() const =0
T * AddComponent(ComponentManager *mgr, const EntityId id, P &&... param)
T * GetComponent(ComponentManager *mgr, const EntityId id)
static const EntityId INVALID_ENTITY_ID
void RemoveComponent(ComponentManager *mgr, const EntityId id)
static constexpr value_type INVALID_HANDLE