From b0856d3d0f5e5611f50e55bd92617b53115b7fcd Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 19 Aug 2024 12:23:25 +0200 Subject: [PATCH] nilrider:: gen_layer_list --- rogueviz/nilrider/nilrider.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rogueviz/nilrider/nilrider.h b/rogueviz/nilrider/nilrider.h index 7884b012..a5a03974 100644 --- a/rogueviz/nilrider/nilrider.h +++ b/rogueviz/nilrider/nilrider.h @@ -207,6 +207,14 @@ struct level { char mapchar(xy_int p); char mapchar(xy_float p) { return mapchar(pfloor(p)); } char mapchar(hyperpoint h) { return mapchar(pfloor(get_xy_f(h))); } + + void gen_layer_list(vector& all) { + all.push_back(this); for(auto s: sublevels) s->gen_layer_list(all); + } + + vector gen_layer_list() { + vector res; gen_layer_list(res); return res; + } }; /** wheel radius */