#pragma once #include "utility.h" #include #include #include #include #include using ComponentVectorTuple = std::tuple < std::vector, std::vector, std::vector >; class EntityMemoryPool { private: ComponentVectorTuple m_components; std::vector m_tags; std::vector m_aliveStates; std::vector m_ids; private: EntityMemoryPool(); EntityMemoryPool(const EntityMemoryPool&) = delete; public: static EntityMemoryPool& instance(); template bool hasComponent(EntityIndex) const; template T& getComponent(EntityIndex) const; template T& getComponent(EntityIndex); EntityTag getTag(EntityIndex) const; bool getAlive(EntityIndex) const; size_t getId(EntityIndex) const; void removeEntity(EntityIndex); };