diff options
Diffstat (limited to 'src/crepe/manager')
-rw-r--r-- | src/crepe/manager/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/crepe/manager/ReplayManager.cpp | 8 | ||||
-rw-r--r-- | src/crepe/manager/ReplayManager.h | 32 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/crepe/manager/CMakeLists.txt b/src/crepe/manager/CMakeLists.txt index 480c8ee..459bbfa 100644 --- a/src/crepe/manager/CMakeLists.txt +++ b/src/crepe/manager/CMakeLists.txt @@ -5,6 +5,7 @@ target_sources(crepe PUBLIC SaveManager.cpp SceneManager.cpp ResourceManager.cpp + ReplayManager.cpp ) target_sources(crepe PUBLIC FILE_SET HEADERS FILES @@ -19,5 +20,6 @@ target_sources(crepe PUBLIC FILE_SET HEADERS FILES SceneManager.hpp ResourceManager.h ResourceManager.hpp + ReplayManager.h ) diff --git a/src/crepe/manager/ReplayManager.cpp b/src/crepe/manager/ReplayManager.cpp new file mode 100644 index 0000000..3643a8e --- /dev/null +++ b/src/crepe/manager/ReplayManager.cpp @@ -0,0 +1,8 @@ +#include "ReplayManager.h" +#include "manager/Manager.h" + +using namespace crepe; + +ReplayManager::ReplayManager(Mediator & mediator) : Manager(mediator) { +} + diff --git a/src/crepe/manager/ReplayManager.h b/src/crepe/manager/ReplayManager.h new file mode 100644 index 0000000..242eae4 --- /dev/null +++ b/src/crepe/manager/ReplayManager.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Manager.h" + +namespace crepe { + +class ReplaySystem; +class Memento; + +typedef size_t recording_t; + +class ReplayManager : public Manager { +public: + ReplayManager(Mediator & mediator); + friend class ReplaySystem; + +protected: + void record_frame(); + +private: + bool recording; + struct Recording { + recording_t id; + std::vector<Memento> frames; + }; +public: + void record_start(); + recording_t record_end(); + +}; + +} // namespace crepe |