diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-28 10:13:11 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-28 10:13:11 +0100 |
commit | 6fd7cec7d4bbf5aeb361b3f1337671bb0f9af61b (patch) | |
tree | 01f6977c66a1e07e07aae42358a7e1a4e55ef53c /src/crepe/api/LoopManager.hpp | |
parent | d1eed940b8119e95a14f1d08bf26184c7f0a0d8f (diff) |
manager mediator refactor
Diffstat (limited to 'src/crepe/api/LoopManager.hpp')
-rw-r--r-- | src/crepe/api/LoopManager.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/crepe/api/LoopManager.hpp b/src/crepe/api/LoopManager.hpp index 9cf470b..cd6bd02 100644 --- a/src/crepe/api/LoopManager.hpp +++ b/src/crepe/api/LoopManager.hpp @@ -38,8 +38,11 @@ void LoopManager::load_system() { static_assert(is_base_of<System, T>::value, "load_system must recieve a derivative class of System"); - System * system = new T(this->component_manager); - this->systems[typeid(T)] = unique_ptr<System>(system); + System * system = new T(this->mediator); + const type_info & type = typeid(T); + if (this->systems.contains(type)) + throw runtime_error(format("LoopManager: {} is already initialized", type.name())); + this->systems[type] = unique_ptr<System>(system); } } // namespace crepe |