1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

reg3:: added at for debugging and fixed a bug with shvid called for incorrect map

This commit is contained in:
Zeno Rogue 2021-07-09 16:07:26 +02:00
parent 064c6015b6
commit f9a55d13c8

View File

@ -646,7 +646,7 @@ EX namespace reg3 {
vector<vector<vector<int>>> move_sequences; vector<vector<vector<int>>> move_sequences;
transmatrix adj(heptagon *h, int d) override { return tmatrices[h->fieldval][d]; } transmatrix adj(heptagon *h, int d) override { return tmatrices[h->fieldval][d]; }
transmatrix adj(cell *c, int d) override { return tmatrices_cell[local_id[c].first][d]; } transmatrix adj(cell *c, int d) override { return tmatrices_cell[local_id.at(c).first][d]; }
heptagon *getOrigin() override { return allh[0]; } heptagon *getOrigin() override { return allh[0]; }
@ -657,12 +657,12 @@ EX namespace reg3 {
vector<hyperpoint> get_vertices(cell* c) override { vector<hyperpoint> get_vertices(cell* c) override {
if(PURE) return cgi.vertices_only; if(PURE) return cgi.vertices_only;
int id = local_id[c].second; int id = local_id.at(c).second;
return cgi.subshapes[id].vertices_only_local; return cgi.subshapes[id].vertices_only_local;
} }
transmatrix master_relative(cell *c, bool get_inverse) { transmatrix master_relative(cell *c, bool get_inverse) {
int id = local_id[c].second; int id = local_id.at(c).second;
auto& ss = cgi.subshapes[id]; auto& ss = cgi.subshapes[id];
return get_inverse ? ss.from_cellcenter : ss.to_cellcenter; return get_inverse ? ss.from_cellcenter : ss.to_cellcenter;
} }
@ -670,7 +670,7 @@ EX namespace reg3 {
void make_subconnections(); void make_subconnections();
int wall_offset(cell *c) override; int wall_offset(cell *c) override;
int shvid(cell *c) { return local_id[c].second; } int shvid(cell *c) { return local_id.at(c).second; }
}; };
struct hrmap_quotient3 : hrmap_closed3 { }; struct hrmap_quotient3 : hrmap_closed3 { };
@ -1825,31 +1825,32 @@ EX namespace reg3 {
transmatrix master_relative(cell *c, bool get_inverse) { transmatrix master_relative(cell *c, bool get_inverse) {
if(PURE) return Id; if(PURE) return Id;
int aid = cell_id[c]; int aid = cell_id.at(c);
return quotient_map->master_relative(quotient_map->acells[aid], get_inverse); return quotient_map->master_relative(quotient_map->acells[aid], get_inverse);
} }
int shvid(cell *c) { int shvid(cell *c) {
if(PURE) return 0; if(PURE) return 0;
int aid = cell_id[c]; if(!cell_id.count(c)) return quotient_map->shvid(c);
int aid = cell_id.at(c);
return quotient_map->shvid(quotient_map->acells[aid]); return quotient_map->shvid(quotient_map->acells[aid]);
} }
int wall_offset(cell *c) override { int wall_offset(cell *c) override {
if(PURE) return 0; if(PURE) return 0;
int aid = cell_id[c]; int aid = cell_id.at(c);
return quotient_map->wall_offset(quotient_map->acells[aid]); return quotient_map->wall_offset(quotient_map->acells[aid]);
} }
transmatrix adj(cell *c, int d) override { transmatrix adj(cell *c, int d) override {
if(PURE) return adj(c->master, d); if(PURE) return adj(c->master, d);
int aid = cell_id[c]; int aid = cell_id.at(c);
return quotient_map->tmatrices_cell[aid][d]; return quotient_map->tmatrices_cell[aid][d];
} }
vector<hyperpoint> get_vertices(cell* c) override { vector<hyperpoint> get_vertices(cell* c) override {
if(PURE) return cgi.vertices_only; if(PURE) return cgi.vertices_only;
int aid = cell_id[c]; int aid = cell_id.at(c);
return quotient_map->get_vertices(quotient_map->acells[aid]); return quotient_map->get_vertices(quotient_map->acells[aid]);
} }
@ -1873,7 +1874,7 @@ EX namespace reg3 {
c->c.connect(d, h->c7, c->master->c.spin(d), false); c->c.connect(d, h->c7, c->master->c.spin(d), false);
return; return;
} }
int id = cell_id[c]; int id = cell_id.at(c);
heptagon *h = c->master; heptagon *h = c->master;
for(int dir: quotient_map->move_sequences[id][d]) for(int dir: quotient_map->move_sequences[id][d])
h = h->cmove(dir); h = h->cmove(dir);