37 lines
512 B
C++
37 lines
512 B
C++
#pragma once
|
|
|
|
#include <utility.h>
|
|
|
|
class EntityManager;
|
|
class EntityView;
|
|
class EntityMemoryPool;
|
|
|
|
class Entity
|
|
{
|
|
public:
|
|
friend class EntityManager;
|
|
friend class EntityView;
|
|
friend class EntityMemoryPool;
|
|
|
|
Entity() = delete;
|
|
Entity(EntityIndex);
|
|
|
|
public:
|
|
template<typename T>
|
|
bool hasComponent() const;
|
|
|
|
template<typename T>
|
|
T& getComponent() const;
|
|
|
|
template<typename T>
|
|
void addComponent(const T&);
|
|
|
|
size_t id() const;
|
|
|
|
Tag tag() const;
|
|
|
|
bool isAlive() const;
|
|
|
|
private:
|
|
EntityIndex m_index;
|
|
}; |