|
|
|
@ -66,6 +66,7 @@ TEST_CASE("basic save a world", "[save]") { |
|
|
|
|
world.set<Position>(player.entity, {10,10}); |
|
|
|
|
world.set<Motion>(player.entity, {0, 0}); |
|
|
|
|
world.set<Combat>(player.entity, {100, 10}); |
|
|
|
|
world.set<Tile>(player.entity, {"@"}); |
|
|
|
|
|
|
|
|
|
save::to_file("./savetest.world", world, map); |
|
|
|
|
|
|
|
|
@ -78,15 +79,19 @@ TEST_CASE("basic save a world", "[save]") { |
|
|
|
|
REQUIRE(position1.location.x == position2.location.x); |
|
|
|
|
REQUIRE(position1.location.y == position2.location.y); |
|
|
|
|
|
|
|
|
|
Combat &combat1 = in_world.get<Combat>(player.entity); |
|
|
|
|
Combat &combat1 = world.get<Combat>(player.entity); |
|
|
|
|
Combat &combat2 = in_world.get<Combat>(player.entity); |
|
|
|
|
REQUIRE(combat1.hp == combat2.hp); |
|
|
|
|
|
|
|
|
|
Motion &motion1 = in_world.get<Motion>(player.entity); |
|
|
|
|
Motion &motion1 = world.get<Motion>(player.entity); |
|
|
|
|
Motion &motion2 = in_world.get<Motion>(player.entity); |
|
|
|
|
REQUIRE(motion1.dx == motion2.dx); |
|
|
|
|
REQUIRE(motion1.dy == motion2.dy); |
|
|
|
|
|
|
|
|
|
Tile &tile1 = world.get<Tile>(player.entity); |
|
|
|
|
Tile &tile2 = in_world.get<Tile>(player.entity); |
|
|
|
|
REQUIRE(tile1.chr == tile2.chr); |
|
|
|
|
|
|
|
|
|
REQUIRE(map.width() == in_map.width()); |
|
|
|
|
REQUIRE(map.height() == in_map.height()); |
|
|
|
|
REQUIRE(map.$walls == in_map.$walls); |
|
|
|
|