default_levs() as a function

This commit is contained in:
Zeno Rogue 2020-01-28 10:20:39 +01:00
parent 00262e8f6a
commit 4287ddf883
2 changed files with 11 additions and 1 deletions

View File

@ -133,6 +133,14 @@ EX bool grailWasFound(cell *c) {
return c->master->alt->alt->emeraldval & GRAIL_FOUND;
}
EX int default_levs() {
if(IRREGULAR)
return 1;
if(S3 >= OINF)
return 1;
return S3-3;
}
void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
if(hybri) { PIU ( generateAlts(h, levs, link_cdata) ); }
if(!h->alt) return;

View File

@ -11,6 +11,8 @@
namespace hr {
#if HDR
extern int default_levs();
struct hrmap {
virtual heptagon *getOrigin() { return NULL; }
virtual cell *gamestart() { return getOrigin()->c7; }
@ -18,7 +20,7 @@ struct hrmap {
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);
virtual void generateAlts(heptagon *h, int levs = default_levs(), bool link_cdata = true);
heptagon *may_create_step(heptagon *h, int direction) {
if(h->move(direction)) return h->move(direction);
return create_step(h, direction);