diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-04 08:28:18 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-04 08:28:18 +0100 |
commit | 06f65659fc6ffde7cabd2135040cbfbf089e5a24 (patch) | |
tree | e3570bea52b87b6919550ee81d17927ccbc11cc5 /src/crepe/ComponentManager.h | |
parent | 128969619a22dfc17a9ea35335c0d21c6ad0c954 (diff) | |
parent | 6aa8fdd04728b6a499f526de727514ae3d0490b4 (diff) |
merge `origin/master` into `master`
Diffstat (limited to 'src/crepe/ComponentManager.h')
-rw-r--r-- | src/crepe/ComponentManager.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h index 2ab9dc8..2b5e1df 100644 --- a/src/crepe/ComponentManager.h +++ b/src/crepe/ComponentManager.h @@ -4,7 +4,6 @@ #include <memory> #include <typeindex> #include <unordered_map> -#include <utility> #include <vector> #include "Component.h" @@ -23,7 +22,7 @@ public: public: //! Add a component of a specific type template <typename T, typename... Args> - void add_component(uint32_t id, Args &&... args); + T & add_component(uint32_t id, Args &&... args); //! Deletes all components of a specific type and id template <typename T> void delete_components_by_id(uint32_t id); @@ -44,7 +43,8 @@ public: std::vector<std::reference_wrapper<T>> get_components_by_type() const; private: - ComponentManager() = default; + ComponentManager(); + virtual ~ComponentManager(); /* * The std::unordered_map<std::type_index, std::vector<std::vector<std::unique_ptr<Component>>>> below might seem a bit strange, let me explain this structure: |