aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/LoopManager.hpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-05 17:25:50 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-05 17:25:50 +0100
commit0b942f4d6eb87fb623afbbae617478674c612ccc (patch)
tree9fd575e1793367e744b60b7d2bed626a72dc70f4 /src/crepe/api/LoopManager.hpp
parent121387ba92a23d6f17b36331d25757abc899f7d2 (diff)
parent1f4e961d7f9d6887c807cac1a362f2d178b0860b (diff)
Merge remote-tracking branch 'origin/master' into max/AI
Diffstat (limited to 'src/crepe/api/LoopManager.hpp')
-rw-r--r--src/crepe/api/LoopManager.hpp7
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