diff --git a/src/EC/Manager.hpp b/src/EC/Manager.hpp index 5f10fd6..bca25fa 100644 --- a/src/EC/Manager.hpp +++ b/src/EC/Manager.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -67,14 +68,14 @@ namespace EC template struct Storage { - using type = std::tuple..., std::vector >; + using type = std::tuple..., std::deque >; }; using ComponentsStorage = typename EC::Meta::Morph >::type; // Entity: isAlive, ComponentsTags Info using EntitiesTupleType = std::tuple; - using EntitiesType = std::vector; + using EntitiesType = std::deque; EntitiesType entities; ComponentsStorage componentsStorage; @@ -103,7 +104,7 @@ namespace EC } EC::Meta::forEach([this, newCapacity] (auto t) { - std::get >( + std::get >( this->componentsStorage).resize(newCapacity); }); @@ -410,10 +411,10 @@ namespace EC constexpr auto index = EC::Meta::IndexOf::value; - // Cast required due to compiler thinking that vector at + // Cast required due to compiler thinking that deque at // index = Components::size is being used, even if the previous // if statement will prevent this from ever happening. - (*((std::vector*)(&std::get( + (*((std::deque*)(&std::get( componentsStorage ))))[entityID] = std::move(component); }