From 374d52bb587d34d5e53febaf9db98ea59e9ef3e1 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 9 Nov 2019 11:20:18 +0100 Subject: [PATCH] default allcells builds the list on all quotient spaces, and generates some list if there is no dcal --- cell.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cell.cpp b/cell.cpp index a92fa457..d867e1fa 100644 --- a/cell.cpp +++ b/cell.cpp @@ -15,7 +15,7 @@ struct hrmap { virtual heptagon *getOrigin() { return NULL; } virtual cell *gamestart() { return getOrigin()->c7; } virtual ~hrmap() { }; - virtual vector& allcells() { return dcal; } + virtual vector& allcells(); virtual void verify() { } virtual void link_alt(const cellwalker& hs) { } virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3 >= OINF ? 1 : S3-3, bool link_cdata = true); @@ -66,6 +66,23 @@ struct hrmap_hyperbolic : hrmap_standard { }; #endif +vector& hrmap::allcells() { + static vector default_allcells; + println(hlog, "bounded = ", !!bounded, " dcal = ", isize(dcal)); + if(bounded) { + celllister cl(gamestart(), 1000000, 1000000, NULL); + default_allcells = cl.lst; + return default_allcells; + } + if(isize(dcal) <= 1) { + extern cellwalker cwt; + celllister cl(cwt.at, 1, 1000, NULL); + default_allcells = cl.lst; + return default_allcells; + } + return dcal; + } + EX int dirdiff(int dd, int t) { dd %= t; if(dd<0) dd += t;