diff options
Diffstat (limited to 'src/crepe/manager/SystemManager.cpp')
-rw-r--r-- | src/crepe/manager/SystemManager.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/crepe/manager/SystemManager.cpp b/src/crepe/manager/SystemManager.cpp index 8fd80a7..db7430e 100644 --- a/src/crepe/manager/SystemManager.cpp +++ b/src/crepe/manager/SystemManager.cpp @@ -8,6 +8,7 @@ #include "../system/RenderSystem.h" #include "../system/ScriptSystem.h" #include "../system/EventSystem.h" +#include "../system/ReplaySystem.h" #include "SystemManager.h" @@ -15,6 +16,7 @@ using namespace crepe; using namespace std; SystemManager::SystemManager(Mediator & mediator) : Manager(mediator) { + this->load_system<ReplaySystem>(); this->load_system<ScriptSystem>(); this->load_system<AISystem>(); this->load_system<PhysicsSystem>(); @@ -43,3 +45,23 @@ void SystemManager::frame_update() { } } +SystemManager::Snapshot SystemManager::save() { + Snapshot snapshot; + for (auto & [type, system] : this->systems) { + snapshot[type] = system->active; + } + return snapshot; +} + +void SystemManager::restore(const Snapshot & snapshot) { + for (auto & [type, active] : snapshot) { + this->systems[type]->active = active; + } +} + +void SystemManager::disable_all() { + for (auto & [type, system] : this->systems) { + system->active = false; + } +} + |