41 lines
608 B
C++
41 lines
608 B
C++
#pragma once
|
|
|
|
#include <utility.h>
|
|
|
|
class EntityManager;
|
|
class EntityViewIterator;
|
|
class EntityViewConstIterator;
|
|
|
|
class Entity
|
|
{
|
|
//private:
|
|
public:
|
|
friend class EntityManager;
|
|
friend class EntityViewIterator;
|
|
friend class EntityViewConstIterator;
|
|
|
|
Entity() = delete;
|
|
Entity(EntityIndex);
|
|
|
|
public:
|
|
template<typename T>
|
|
bool hasComponent() const;
|
|
|
|
template<typename T>
|
|
T& getComponent() const;
|
|
|
|
template<typename T>
|
|
T& getComponent();
|
|
|
|
template<typename T>
|
|
void addComponent(const T&&);
|
|
|
|
EntityIndex id() const;
|
|
|
|
EntityTag tag() const;
|
|
|
|
bool isAlive() const;
|
|
|
|
private:
|
|
EntityIndex m_index;
|
|
}; |