#include #include #include //#include #include EntityMemoryPool::EntityMemoryPool() { std::apply([=](auto&&... args) {((args.reserve(Global::MAX_ENTITIES)), ...); }, m_components); m_tags.reserve(Global::MAX_ENTITIES); m_aliveStates.reserve(Global::MAX_ENTITIES); } EntityMemoryPool& EntityMemoryPool::instance() { static EntityMemoryPool pool{}; return pool; } template bool EntityMemoryPool::hasComponent(EntityIndex id) const { return std::get>(m_components)[id].active; } template T& EntityMemoryPool::getComponent(EntityIndex id) const { return std::get>(m_components)[id]; } template T& EntityMemoryPool::getComponent(EntityIndex id) { return std::get>(m_components)[id]; } EntityTag EntityMemoryPool::getTag(EntityIndex id) const { return m_tags[id]; } bool EntityMemoryPool::getAlive(EntityIndex id) const { return m_aliveStates[id]; }