aboutsummaryrefslogtreecommitdiff
path: root/src/test/ECSTest.cpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
commit79d3a9f4311e6684b6df83a15ca7844f58c1959c (patch)
treeb2883e83f61cee9edf290a6a7228c7f0b1fbae8a /src/test/ECSTest.cpp
parent9140b73e4af7aa925b53e4fb4e6aa7f4ea2e3385 (diff)
parent03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff)
Merge remote-tracking branch 'origin/master' into max/game
Diffstat (limited to 'src/test/ECSTest.cpp')
-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}));
+}