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:
parent
dca95aa2aa
commit
fd67768234
9
game.cpp
9
game.cpp
@ -4278,6 +4278,15 @@ EX int pickDownDirection(cell *c, flagtype mf) {
|
||||
}
|
||||
|
||||
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();
|
||||
switch(geometry) {
|
||||
case gBinary3:
|
||||
|
@ -204,9 +204,6 @@ static const struct revstep_t { revstep_t() {}} revstep;
|
||||
|
||||
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. */
|
||||
template<class T> struct walker {
|
||||
/** where we are at */
|
||||
|
Loading…
Reference in New Issue
Block a user