handlers for createStep and newmap

This commit is contained in:
Zeno Rogue 2018-11-30 14:37:59 +01:00
parent ce996c82fe
commit bf7bb61d35
4 changed files with 11 additions and 3 deletions

View File

@ -1165,11 +1165,15 @@ euc_pointer euclideanAtCreate(int vec) {
return ep;
}
hookset<hrmap*()> *hooks_newmap;
// initializer (also inits origin from heptagon.cpp)
void initcells() {
DEBB(DF_INIT, (debugfile,"initcells\n"));
if(archimedean) currentmap = arcm::new_map();
hrmap* res = callhandlers((hrmap*)nullptr, hooks_newmap);
if(res) currentmap = res;
else if(archimedean) currentmap = arcm::new_map();
else if(fulltorus) currentmap = new hrmap_torus;
else if(euclid) currentmap = new hrmap_euclidean;
else if(sphere) currentmap = new hrmap_spherical;

View File

@ -1660,7 +1660,7 @@ vector<eLand> randlands = {
static const int qNONOR = qNONORIENTABLE;
geometryinfo ginf[gGUARD] = {
vector<geometryinfo> ginf = {
{"standard", "HR", 7, 3, 0, gcHyperbolic, 0, {{7, 5}}, eVariation::bitruncated},
{"Euclidean", "euclid", 6, 3, 0, gcEuclid, 0, {{7, FORBIDDEN}}, eVariation::bitruncated},
{"spherical", "sphere", 5, 3, 0, gcSphere, 0, {{SEE_ALL, SEE_ALL}}, eVariation::bitruncated},

View File

@ -235,7 +235,7 @@ static const int FORBIDDEN = -1;
extern eGeometry geometry;
extern eVariation variation;
extern geometryinfo ginf[gGUARD];
extern std::vector<geometryinfo> ginf;
extern monstertype minf[motypes];
extern itemtype iinf[ittypes];

View File

@ -198,8 +198,12 @@ extern int hrand(int);
// a structure used to walk on the heptagonal tesselation
// (remembers not only the heptagon, but also direction)
hookset<void(heptagon*, int)> *hooks_createStep;
heptagon *createStep(heptagon *h, int d) {
d = h->c.fix(d);
if(!h->move(d))
callhooks(hooks_createStep, h, d);
if(!h->move(d) && binarytiling)
return binary::createStep(h, d);
if(!h->move(d) && archimedean) {