From 313da47b72aafa0b40ac2cd2b586d525ed17fbd4 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 11 Dec 2024 18:51:58 +0100 Subject: more WIP --- src/crepe/manager/ReplayManager.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/crepe/manager/ReplayManager.cpp') diff --git a/src/crepe/manager/ReplayManager.cpp b/src/crepe/manager/ReplayManager.cpp index 40d34a4..82c2275 100644 --- a/src/crepe/manager/ReplayManager.cpp +++ b/src/crepe/manager/ReplayManager.cpp @@ -1,25 +1,36 @@ +#include "../util/Log.h" + #include "ReplayManager.h" -#include "manager/Manager.h" +#include "Manager.h" using namespace crepe; +using namespace std; ReplayManager::ReplayManager(Mediator & mediator) : Manager(mediator) { mediator.replay_manager = *this; } void ReplayManager::record_start() { - + if (this->recording) this->release(this->current_recording); + this->current_recording++; + this->recording = true; } recording_t ReplayManager::record_end() { - return 0; + this->recording = false; + return this->current_recording; } void ReplayManager::play(recording_t handle) { + if (!this->memory.contains(handle)) + throw out_of_range(format("ReplayManager: no recording for handle {}", handle)); + Recording & recording = *this->memory.at(handle); + dbg_log("TODO: magic"); } void ReplayManager::release(recording_t handle) { + dbg_log("release"); } -- cgit v1.2.3