diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-06 13:24:35 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-06 13:24:35 -0500 |
| commit | 6d6e03b95b197d3a16b629131d463263b46c1e42 (patch) | |
| tree | 6e730293c3bbeadb3fe3ebfc3f64016a7e885bff /src/direction.h | |
| parent | 1abc8894c2378596542e5772cd7594492eeecb27 (diff) | |
| download | tanetane-6d6e03b95b197d3a16b629131d463263b46c1e42.tar.gz tanetane-6d6e03b95b197d3a16b629131d463263b46c1e42.tar.bz2 tanetane-6d6e03b95b197d3a16b629131d463263b46c1e42.zip | |
Added sprite interaction
Diffstat (limited to 'src/direction.h')
| -rw-r--r-- | src/direction.h | 13 |
1 files changed, 13 insertions, 0 deletions
| diff --git a/src/direction.h b/src/direction.h index a83a6f8..e11b1f3 100644 --- a/src/direction.h +++ b/src/direction.h | |||
| @@ -51,4 +51,17 @@ inline bool dirHasDir(Direction value, Direction inner) { | |||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | inline Direction oppositeDirection(Direction value) { | ||
| 55 | switch (value) { | ||
| 56 | case Direction::up: return Direction::down; | ||
| 57 | case Direction::up_right: return Direction::down_left; | ||
| 58 | case Direction::right: return Direction::left; | ||
| 59 | case Direction::down_right: return Direction::up_left; | ||
| 60 | case Direction::down: return Direction::up; | ||
| 61 | case Direction::down_left: return Direction::up_right; | ||
| 62 | case Direction::left: return Direction::right; | ||
| 63 | case Direction::up_left: return Direction::down_right; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 54 | #endif /* end of include guard: DIRECTION_H_AB66A90E */ | 67 | #endif /* end of include guard: DIRECTION_H_AB66A90E */ |
