summaryrefslogtreecommitdiffhomepage
path: root/test/critter.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-13 12:26:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-13 12:26:26 +0200
commitcb13eb86db3593e723ce06c48a5cb2c94505d6ae (patch)
tree9b56825b1debc908dc999feace69645eb56eb2f8 /test/critter.cpp
parent2c042d30d96827941e5052d4eca0cc03965cacc8 (diff)
use inheritance for scenery, not std::variant
It's still WIP because creating scenery has to branch on all subtypes. This needs to be taken care of generically in `world::make_object()`.
Diffstat (limited to 'test/critter.cpp')
-rw-r--r--test/critter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/critter.cpp b/test/critter.cpp
index cc46ef72..f7ce3b35 100644
--- a/test/critter.cpp
+++ b/test/critter.cpp
@@ -309,10 +309,14 @@ void test3(StringView instance_name, const Function& make_dt, double accel, rota
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<scenery, false>(w.make_id(), {{}, {0, 0}}, S);
- (void)w.make_object<scenery, false>(w.make_id(), {{}, {1, 1}}, S);
- (void)w.make_object<scenery, false>(w.make_id(), {{}, {14, 14}}, S);
- (void)w.make_object<scenery, false>(w.make_id(), {{}, {15, 15}}, S);
+ (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[chunk_coords_{}].sort_objects();
if (no_unroll)