aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
commit770496ee9d0e45480c0e0f8951adb8eee247bfe1 (patch)
tree98c68b0d37d8a1c0c8b8013ea7884d56f04aaa28 /src/crepe/manager
parent0cb7f2f82ca167656b3c5cb9f0cc3b44c59cb0eb (diff)
big WIP
Diffstat (limited to 'src/crepe/manager')
-rw-r--r--src/crepe/manager/CMakeLists.txt2
-rw-r--r--src/crepe/manager/ReplayManager.cpp8
-rw-r--r--src/crepe/manager/ReplayManager.h32
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