diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-07 15:27:28 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-07 15:27:28 +0100 |
commit | be58cc9342a775c21ec2ee28923414a5c612fe6e (patch) | |
tree | 6cfc5f7d4d403482afc5131f77369c99f0da1241 /src/crepe/ComponentManager.hpp | |
parent | 97515abfb2859e289df9d65d7106f35159749131 (diff) |
add game_object_id_t type
Diffstat (limited to 'src/crepe/ComponentManager.hpp')
-rw-r--r-- | src/crepe/ComponentManager.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp index cf9f65a..98efb49 100644 --- a/src/crepe/ComponentManager.hpp +++ b/src/crepe/ComponentManager.hpp @@ -3,11 +3,12 @@ #include <type_traits> #include "ComponentManager.h" +#include "types.h" namespace crepe { template <class T, typename... Args> -T & ComponentManager::add_component(uint32_t id, Args &&... args) { +T & ComponentManager::add_component(game_object_id_t id, Args &&... args) { using namespace std; static_assert(is_base_of<Component, T>::value, @@ -51,7 +52,7 @@ T & ComponentManager::add_component(uint32_t id, Args &&... args) { } template <typename T> -void ComponentManager::delete_components_by_id(uint32_t id) { +void ComponentManager::delete_components_by_id(game_object_id_t id) { using namespace std; // Determine the type of T (this is used as the key of the unordered_map<>) @@ -83,7 +84,7 @@ void ComponentManager::delete_components() { template <typename T> std::vector<std::reference_wrapper<T>> -ComponentManager::get_components_by_id(uint32_t id) const { +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<>) |