aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 21:04:30 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 21:04:30 +0100
commit359ad8db97305856f4cfdade1cd1dada78a7a635 (patch)
treea6d5dce34c2aa5406744c414baccf6a2450dd8a5 /src/crepe/Component.cpp
parent313da47b72aafa0b40ac2cd2b586d525ed17fbd4 (diff)
more replay system WIP
Diffstat (limited to 'src/crepe/Component.cpp')
-rw-r--r--src/crepe/Component.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/crepe/Component.cpp b/src/crepe/Component.cpp
index 141e1a8..8086492 100644
--- a/src/crepe/Component.cpp
+++ b/src/crepe/Component.cpp
@@ -1,6 +1,7 @@
#include "Component.h"
using namespace crepe;
+using namespace std;
Component::Component(game_object_id_t id) : game_object_id(id) {}
@@ -8,3 +9,11 @@ Component & Component::operator=(const Component &) {
return *this;
}
+unique_ptr<Component> Component::save() const {
+ return unique_ptr<Component>(new Component(*this));
+}
+
+void Component::restore(const Component & snapshot) {
+ *this = snapshot;
+}
+