aboutsummaryrefslogtreecommitdiff
path: root/src/test
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/test
parent313da47b72aafa0b40ac2cd2b586d525ed17fbd4 (diff)
more replay system WIP
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ECSTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ECSTest.cpp b/src/test/ECSTest.cpp
index af2b7b0..8f86a91 100644
--- a/src/test/ECSTest.cpp
+++ b/src/test/ECSTest.cpp
@@ -466,3 +466,17 @@ TEST_F(ECSTest, ComponentsByTag) {
EXPECT_EQ(objects.size(), 3);
}
}
+
+TEST_F(ECSTest, Snapshot) {
+ GameObject foo = mgr.new_object("foo");
+
+ foo.transform.position = {1, 1};
+
+ ComponentManager::Snapshot snapshot = mgr.save();
+
+ foo.transform.position = {0, 0};
+
+ mgr.restore(snapshot);
+
+ EXPECT_EQ(foo.transform.position, (vec2{1, 1}));
+}