#pragma once #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; size_t m_entityCount; // for debugging purposes, should not be included in release version bool m_holePresent{false}; 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; void removeEntity(EntityIndex); };