summaryrefslogtreecommitdiff
path: root/src/geometry/direction.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/geometry/direction.rs')
-rw-r--r--src/geometry/direction.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/geometry/direction.rs b/src/geometry/direction.rs
index 84fe785..119aeee 100644
--- a/src/geometry/direction.rs
+++ b/src/geometry/direction.rs
@@ -53,4 +53,18 @@ impl Direction {
NorthWest => Vec2d::new(-1, -1),
}
}
+
+ pub fn all() -> [Direction; 8] {
+ use Direction::*;
+ [
+ North,
+ NorthEast,
+ East,
+ SouthEast,
+ South,
+ SouthWest,
+ West,
+ NorthWest,
+ ]
+ }
}