mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
handlers for createStep and newmap
This commit is contained in:
parent
ce996c82fe
commit
bf7bb61d35
6
cell.cpp
6
cell.cpp
@ -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;
|
||||
|
@ -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},
|
||||
|
@ -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];
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user