summaryrefslogtreecommitdiff
path: root/src/geometry
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-04-25 21:37:53 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-04-25 21:37:53 +0200
commit3e4f70ff90471120818cfb38a6dbde4952c11b8f (patch)
treeacb2102273f902115d50f6d9a533919d7bc49a20 /src/geometry
parentec9041a9526b52910aafac1f7c0acfc8215ac107 (diff)
Strategy that starts building exhaustive game state tree
This falls over (and takes the host machine with it) because its memory usage grows catastrophically. The main use of time, reported by perf, was cloning the map vector.
Diffstat (limited to 'src/geometry')
-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,
+ ]
+ }
}