summaryrefslogtreecommitdiffhomepage
path: root/test/critter.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-13 17:42:30 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-13 17:42:30 +0200
commit2260ab972100f1d6679690b730b6f0aa7409b014 (patch)
tree18386a59968c1e7933db702281fc13fe62ff9b1e /test/critter.cpp
parentcb13eb86db3593e723ce06c48a5cb2c94505d6ae (diff)
instantiate scenery in a uniform manner
Now using world::make_scenery(). Add `std::monostate` to the `scenery_proto` variant to catch potential bugs.
Diffstat (limited to 'test/critter.cpp')
-rw-r--r--test/critter.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/critter.cpp b/test/critter.cpp
index f7ce3b35..72bb58cc 100644
--- a/test/critter.cpp
+++ b/test/critter.cpp
@@ -302,21 +302,17 @@ void test2(StringView instance_name, const Function& make_dt, double accel, uint
void test3(StringView instance_name, const Function& make_dt, double accel, rotation r, bool no_unroll)
{
const auto W = wall_image_proto{ loader.wall_atlas("empty"), 0 };
- const auto S = scenery_proto{loader.scenery("table0")};
+ auto S = loader.scenery("table0");
auto w = world();
w[{{-1,-1,0}, {13,13}}].t.wall_north() = W;
w[{{-1,-1,0}, {13,13}}].t.wall_west() = W;
w[{{1,1,0}, {4,5}}].t.wall_north() = W;
w[{{1,1,0}, {5,4}}].t.wall_west() = W;
- (void)w.make_object<generic_scenery, false>(w.make_id(), {{}, {0, 0}},
- std::get<generic_scenery_proto>(S.subtype), S); // todo!
- (void)w.make_object<generic_scenery, false>(w.make_id(), {{}, {1, 1}},
- std::get<generic_scenery_proto>(S.subtype), S);
- (void)w.make_object<generic_scenery, false>(w.make_id(), {{}, {14, 14}},
- std::get<generic_scenery_proto>(S.subtype), S);
- (void)w.make_object<generic_scenery, false>(w.make_id(), {{}, {15, 15}},
- std::get<generic_scenery_proto>(S.subtype), S);
+ w.make_scenery(w.make_id(), {{}, {0, 0}}, scenery_proto(S));
+ w.make_scenery(w.make_id(), {{}, {1, 1}}, scenery_proto(S));
+ w.make_scenery(w.make_id(), {{}, {14, 14}}, scenery_proto(S));
+ w.make_scenery(w.make_id(), {{}, {15, 15}}, scenery_proto(S));
w[chunk_coords_{}].sort_objects();
if (no_unroll)