aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/CMakeLists.txt1
-rw-r--r--src/crepe/system/EventSystem.h7
-rw-r--r--src/crepe/system/ReplaySystem.h15
3 files changed, 23 insertions, 0 deletions
diff --git a/src/crepe/system/CMakeLists.txt b/src/crepe/system/CMakeLists.txt
index 3473876..52369d0 100644
--- a/src/crepe/system/CMakeLists.txt
+++ b/src/crepe/system/CMakeLists.txt
@@ -23,5 +23,6 @@ target_sources(crepe PUBLIC FILE_SET HEADERS FILES
AnimatorSystem.h
InputSystem.h
EventSystem.h
+ ReplaySystem.h
AISystem.h
)
diff --git a/src/crepe/system/EventSystem.h b/src/crepe/system/EventSystem.h
index a179d00..ff3ca4e 100644
--- a/src/crepe/system/EventSystem.h
+++ b/src/crepe/system/EventSystem.h
@@ -4,10 +4,17 @@
namespace crepe {
+/**
+ * \brief EventManager dispatch helper system
+ */
class EventSystem : public System {
public:
using System::System;
+ /**
+ * \brief Dispatch queued events
+ * \see EventManager::dispatch_events
+ */
void fixed_update() override;
};
diff --git a/src/crepe/system/ReplaySystem.h b/src/crepe/system/ReplaySystem.h
index 919c554..8ba60d5 100644
--- a/src/crepe/system/ReplaySystem.h
+++ b/src/crepe/system/ReplaySystem.h
@@ -7,6 +7,11 @@
namespace crepe {
+/**
+ * \brief ReplayManager helper system
+ *
+ * This system records and replays recordings using ReplayManager.
+ */
class ReplaySystem : public System {
public:
using System::System;
@@ -14,15 +19,25 @@ public:
void fixed_update() override;
private:
+ //! Last ReplayManager state
ReplayManager::State last_state = ReplayManager::IDLE;
+ /**
+ * \brief Playback snapshot
+ *
+ * When starting playback, the component state is saved and most systems are disabled. This
+ * struct stores the engine state before ReplayManager::play is called.
+ */
struct Snapshot {
ComponentManager::Snapshot components;
SystemManager::Snapshot systems;
};
+ //! Before playback snapshot
Snapshot playback;
+ //! Snapshot state and disable systems during playback
void playback_begin();
+ //! Restore state from before \c playback_begin()
void playback_end();
};