diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-11-21 20:40:08 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-11-21 20:40:08 +0100 |
commit | d58a059fd6398527274e77a37b65aa105c8a778b (patch) | |
tree | 26d345400739ec685bbe6b26d8d789bbe33b02aa /src/crepe/ComponentManager.hpp | |
parent | faa9adb84ad3f675587b52fba79cf44b7bdd2034 (diff) | |
parent | 115d6f50152dc018073345800ca90b85846ebaa9 (diff) |
merge with master
Diffstat (limited to 'src/crepe/ComponentManager.hpp')
-rw-r--r-- | src/crepe/ComponentManager.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp index be99cac..4d5eaf4 100644 --- a/src/crepe/ComponentManager.hpp +++ b/src/crepe/ComponentManager.hpp @@ -81,15 +81,14 @@ void ComponentManager::delete_components() { } template <typename T> -std::vector<std::reference_wrapper<T>> -ComponentManager::get_components_by_id(game_object_id_t id) const { +RefVector<T> ComponentManager::get_components_by_id(game_object_id_t id) const { using namespace std; // Determine the type of T (this is used as the key of the unordered_map<>) type_index type = typeid(T); // Create an empty vector<> - vector<reference_wrapper<T>> component_vector; + RefVector<T> component_vector; if (this->components.find(type) == this->components.end()) return component_vector; @@ -114,14 +113,14 @@ ComponentManager::get_components_by_id(game_object_id_t id) const { } template <typename T> -std::vector<std::reference_wrapper<T>> ComponentManager::get_components_by_type() const { +RefVector<T> ComponentManager::get_components_by_type() const { using namespace std; // Determine the type of T (this is used as the key of the unordered_map<>) type_index type = typeid(T); // Create an empty vector<> - vector<reference_wrapper<T>> component_vector; + RefVector<T> component_vector; // Find the type (in the unordered_map<>) if (this->components.find(type) == this->components.end()) return component_vector; |