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

reverse_directions for heptagons

This commit is contained in:
Zeno Rogue 2019-09-26 13:13:44 +02:00
parent dca95aa2aa
commit fd67768234
2 changed files with 9 additions and 3 deletions

View File

@ -4278,6 +4278,15 @@ EX int pickDownDirection(cell *c, flagtype mf) {
} }
EX vector<int> reverse_directions(cell *c, int dir) { EX vector<int> reverse_directions(cell *c, int dir) {
if(PURE) return reverse_directions(c->master, dir);
int d = c->degree();
if(d & 1)
return { gmod(dir + c->type/2, c->type), gmod(dir + (c->type+1)/2, c->type) };
else
return { gmod(dir + c->type/2, c->type) };
}
EX vector<int> reverse_directions(heptagon *c, int dir) {
int d = c->degree(); int d = c->degree();
switch(geometry) { switch(geometry) {
case gBinary3: case gBinary3:

View File

@ -204,9 +204,6 @@ static const struct revstep_t { revstep_t() {}} revstep;
extern int hrand(int); extern int hrand(int);
/** reverse directions are currently not implemented for heptagons */
inline vector<int> reverse_directions(struct heptagon *c, int i) { throw "unimplemented"; }
/** the walker structure is used for walking on surfaces defined via \ref connection_table. */ /** the walker structure is used for walking on surfaces defined via \ref connection_table. */
template<class T> struct walker { template<class T> struct walker {
/** where we are at */ /** where we are at */