aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/SystemManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/manager/SystemManager.cpp')
-rw-r--r--src/crepe/manager/SystemManager.cpp45
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();
+ }
+}
+