diff options
Diffstat (limited to 'backend/Location.cpp')
-rw-r--r-- | backend/Location.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/Location.cpp b/backend/Location.cpp index c036c7b..eadbef2 100644 --- a/backend/Location.cpp +++ b/backend/Location.cpp @@ -5,6 +5,10 @@ #include "Object.h" #include "util.h" +Direction operator - (const Direction & rhs) { + return static_cast<Direction>((rhs + 2) % 4); +} + Direction random_direction() { return DIRECTIONS[RNG::get().rand_int(4)]; } |