summaryrefslogtreecommitdiff
path: root/src/map/magic-interpreter.t.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/magic-interpreter.t.hpp')
-rw-r--r--src/map/magic-interpreter.t.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp
index 49fd3e1..26dc8d9 100644
--- a/src/map/magic-interpreter.t.hpp
+++ b/src/map/magic-interpreter.t.hpp
@@ -64,6 +64,21 @@ enum class DIR : uint8_t
COUNT,
};
+constexpr
+earray<int, DIR, DIR::COUNT> dirx //=
+{{
+ 0, -1, -1, -1, 0, 1, 1, 1,
+}}, diry //=
+{{
+ 1, 1, 0, -1, -1, -1, 0, 1,
+}};
+
+constexpr
+bool dir_is_diagonal(DIR d)
+{
+ return static_cast<uint8_t>(d) & 1;
+}
+
enum class AREA : uint8_t
{
LOCATION,