diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 21:19:57 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 21:19:57 +0100 |
commit | 000062b462a3af86db4dac4d8c9e5ef32feb2996 (patch) | |
tree | d766704f5862520ead6a03656103dd2fbcce99e9 /src/crepe/manager/SystemManager.cpp | |
parent | 359ad8db97305856f4cfdade1cd1dada78a7a635 (diff) |
split up loopmanager into SystemManager and Engine
Diffstat (limited to 'src/crepe/manager/SystemManager.cpp')
-rw-r--r-- | src/crepe/manager/SystemManager.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/crepe/manager/SystemManager.cpp b/src/crepe/manager/SystemManager.cpp new file mode 100644 index 0000000..8fd80a7 --- /dev/null +++ b/src/crepe/manager/SystemManager.cpp @@ -0,0 +1,45 @@ +#include "../system/AISystem.h" +#include "../system/AnimatorSystem.h" +#include "../system/AudioSystem.h" +#include "../system/CollisionSystem.h" +#include "../system/InputSystem.h" +#include "../system/ParticleSystem.h" +#include "../system/PhysicsSystem.h" +#include "../system/RenderSystem.h" +#include "../system/ScriptSystem.h" +#include "../system/EventSystem.h" + +#include "SystemManager.h" + +using namespace crepe; +using namespace std; + +SystemManager::SystemManager(Mediator & mediator) : Manager(mediator) { + this->load_system<ScriptSystem>(); + this->load_system<AISystem>(); + 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>(); + + this->mediator.system_manager = *this; +} + +void SystemManager::fixed_update() { + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->fixed_update(); + } +} + +void SystemManager::frame_update() { + for (auto & [type, system] : this->systems) { + if (!system->active) continue; + system->frame_update(); + } +} + |