diff options
Diffstat (limited to 'mwe/ecs-memory-efficient/src/ComponentManager.cpp')
-rw-r--r-- | mwe/ecs-memory-efficient/src/ComponentManager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mwe/ecs-memory-efficient/src/ComponentManager.cpp b/mwe/ecs-memory-efficient/src/ComponentManager.cpp index 16cc2b6..20d0ce0 100644 --- a/mwe/ecs-memory-efficient/src/ComponentManager.cpp +++ b/mwe/ecs-memory-efficient/src/ComponentManager.cpp @@ -8,14 +8,14 @@ ComponentManager& ComponentManager::GetInstance() { ComponentManager::ComponentManager() {} -void ComponentManager::DeleteAllComponentsOfId(std::uint32_t id) { - for(auto& [type, componentArray] : mComponents) { //Loop through all the types (in the unordered_map<>) - if (id < componentArray.size()) { //Make sure that the id (that we are looking for) is within the boundaries of the vector<> - componentArray[id].clear(); //Clear the components at this specific id - } - } +std::vector<std::reference_wrapper<Sprite>> ComponentManager::getAllSpriteReferences() { + return mSpriteContainer.getAllReferences(); } -void ComponentManager::DeleteAllComponents() { - mComponents.clear(); //Clear the whole unordered_map<> +std::vector<std::reference_wrapper<Rigidbody>> ComponentManager::getAllRigidbodyReferences() { + return mRigidbodyContainer.getAllReferences(); +} + +std::vector<std::reference_wrapper<Colider>> ComponentManager::getAllColiderReferences() { + return mColiderContainer.getAllReferences(); } |