default allcells builds the list on all quotient spaces, and generates some list if there is no dcal

This commit is contained in:
Zeno Rogue 2019-11-09 11:20:18 +01:00
parent e6be9231c9
commit 374d52bb58
1 changed files with 18 additions and 1 deletions

View File

@ -15,7 +15,7 @@ struct hrmap {
virtual heptagon *getOrigin() { return NULL; }
virtual cell *gamestart() { return getOrigin()->c7; }
virtual ~hrmap() { };
virtual vector<cell*>& allcells() { return dcal; }
virtual vector<cell*>& 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<cell*>& hrmap::allcells() {
static vector<cell*> 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;