1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-14 05:57:37 +00:00

rewritten shvid using OOP

This commit is contained in:
Zeno Rogue
2021-06-12 23:34:50 +02:00
parent 8d18946450
commit 42fc2c44a7
8 changed files with 44 additions and 27 deletions

View File

@@ -848,7 +848,7 @@ EX namespace gp {
cgi.extra_vertices();
}
int get_plainshape_id(cell *c) {
EX int get_plainshape_id(cell *c) {
int siid, sidir;
cell *c1 = c;
auto f = [&] {
@@ -924,36 +924,18 @@ EX void set_floor(const transmatrix& spin, hpcshape& sh) {
}
EX int shvid(cell *c) {
if(hybri) {
cell *c1 = hybrid::get_where(c).first;
return PIU( shvid(c1) );
}
else if(GOLDBERG_INV)
return currentmap->shvid(c);
}
int hrmap_standard::shvid(cell *c) {
if(GOLDBERG)
return gp::get_plainshape_id(c);
#if CAP_IRR
else if(IRREGULAR)
return irr::cellindex[c];
#endif
#if CAP_ARCM
else if(arcm::in()) {
auto& ac = arcm::current;
int id = arcm::id_of(c->master);
if(ac.regular && id>=2 && id < 2*ac.N) id &= 1;
return id;
}
#endif
else if(arb::in())
return arb::id_of(c->master);
else if(geosupport_football() == 2)
return pseudohept(c);
#if CAP_BT
else if(geometry == gBinaryTiling)
return c->type-6;
else if(kite::in())
return kite::getshape(c->master);
else if(geometry == gBinary4 || geometry == gTernary)
return c->master->zebraval;
#endif
else if(inforder::mixed()) {
int t = c->type;
static vector<bool> computed;