aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 19:02:40 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 19:02:40 +0100
commit45f1f18c78e73280a8a861df2db6237bae6f6d80 (patch)
tree78468b25ea85b3582fc4eab296142efd6a0dd92f /src/crepe/api/Script.h
parentf34daa492c30a0d28b747817a9f2d6fb0186cf80 (diff)
add script api for replaymanager
Diffstat (limited to 'src/crepe/api/Script.h')
-rw-r--r--src/crepe/api/Script.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h
index 668e5d1..c797db0 100644
--- a/src/crepe/api/Script.h
+++ b/src/crepe/api/Script.h
@@ -2,6 +2,7 @@
#include <vector>
+#include "../manager/ReplayManager.h"
#include "../manager/EventManager.h"
#include "../manager/Mediator.h"
#include "../system/CollisionSystem.h"
@@ -135,6 +136,23 @@ protected:
//! Retrieve SaveManager reference
SaveManager & get_save_manager() const;
+ //! Replay management functions
+ struct replay { // NOLINT
+ //! \copydoc ReplayManager::record_start
+ void record_start();
+ //! \copydoc ReplayManager::record_end
+ recording_t record_end();
+ //! \copydoc ReplayManager::play
+ void play(recording_t);
+ //! \copydoc ReplayManager::release
+ void release(recording_t);
+
+ private:
+ OptionalRef<Mediator> & mediator;
+ replay(OptionalRef<Mediator> & mediator) : mediator(mediator) {}
+ friend class Script;
+ } replay{mediator};
+
//! \}
private: