diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 16:51:03 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 16:51:03 +0100 |
commit | f0ecbea57a4d75905c4ee79608807187cd8f3e72 (patch) | |
tree | 04a399dc7d400aaa9443be19ce13fd97e5822f95 /src/crepe/api/LoopManager.cpp | |
parent | d228d4b3856606ad4395723b2703759a0ebe9832 (diff) |
WIP
Diffstat (limited to 'src/crepe/api/LoopManager.cpp')
-rw-r--r-- | src/crepe/api/LoopManager.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp index 637fbe1..ff428fd 100644 --- a/src/crepe/api/LoopManager.cpp +++ b/src/crepe/api/LoopManager.cpp @@ -13,18 +13,17 @@ using namespace crepe; using namespace std; -LoopManager::LoopManager() - : systems({ - ScriptSystem{this->mediator}, - PhysicsSystem{this->mediator}, - CollisionSystem{this->mediator}, - AnimatorSystem{this->mediator}, - ParticleSystem{this->mediator}, - RenderSystem{this->mediator}, - InputSystem{this->mediator}, - EventSystem{this->mediator}, - AudioSystem{this->mediator}, - }) { } +LoopManager::LoopManager() { + this->load_system<ScriptSystem>(); + this->load_system<PhysicsSystem>(); + this->load_system<CollisionSystem>(); + this->load_system<AnimatorSystem>(); + this->load_system<ParticleSystem>(); + this->load_system<RenderSystem>(); + this->load_system<InputSystem>(); + this->load_system<EventSystem>(); + this->load_system<AudioSystem>(); +} void LoopManager::start() { this->setup(); @@ -32,16 +31,16 @@ void LoopManager::start() { } void LoopManager::fixed_update() { - for (System & system : this->systems) { - if (!system.active) continue; - system.fixed_update(); + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->fixed_update(); } } void LoopManager::frame_update() { - for (System & system : this->systems) { - if (!system.active) continue; - system.frame_update(); + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->frame_update(); } } |