diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-22 12:15:49 +0200 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-22 12:15:49 +0200 |
commit | 6b213f304b35be5c11bbea305698d6e365a7ffca (patch) | |
tree | 4526831be8e6a09a9e1608b71294213ce57fddb1 /src/crepe/ComponentManager.h | |
parent | 9037aca03bfa4312794a6954752628381256f777 (diff) | |
parent | 30d84ef9ad4a0010288db18294766fd4d5ed6f4a (diff) |
Merge branch 'master' into niels/rendering
Diffstat (limited to 'src/crepe/ComponentManager.h')
-rw-r--r-- | src/crepe/ComponentManager.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h index 2ab9dc8..38f32e4 100644 --- a/src/crepe/ComponentManager.h +++ b/src/crepe/ComponentManager.h @@ -23,7 +23,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 +44,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: |