diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 21:50:45 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 21:50:45 +0100 |
commit | d941f497c10bb9146bb83c5c4e59e844d0641a04 (patch) | |
tree | 7dfdf691175caf8e43a9c7a7e07a1cdd6bfed0ff /src/crepe/api/LoopManager.hpp | |
parent | d10f220ff6c5d62bb51793a0ef4ee37090161d89 (diff) | |
parent | cfb67ffddb9f4bb0357c2b9df4239bfee7364c5a (diff) |
merge master
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..266758a 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); + const type_info & type = typeid(T); + if (this->systems.contains(type)) + throw runtime_error(format("LoopManager: {} is already initialized", type.name())); + System * system = new T(this->mediator); + this->systems[type] = unique_ptr<System>(system); } } // namespace crepe |