summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-18 21:22:45 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-18 21:22:45 +0200
commit1b72f37fc04cd7851bd2f289d7776a1c7c35f48d (patch)
tree2349fe545bfa81451f81a7cef8e5838c1cf6acb6 /client/elm/battlemap/src/Battlemap/Direction.elm
parent36344e727e45b6a1d39f372a6a39ab973e023bdf (diff)
Adds backtrack support.
Diffstat (limited to 'client/elm/battlemap/src/Battlemap/Direction.elm')
-rw-r--r--client/elm/battlemap/src/Battlemap/Direction.elm11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/elm/battlemap/src/Battlemap/Direction.elm b/client/elm/battlemap/src/Battlemap/Direction.elm
index b943c2d..e301177 100644
--- a/client/elm/battlemap/src/Battlemap/Direction.elm
+++ b/client/elm/battlemap/src/Battlemap/Direction.elm
@@ -1,4 +1,4 @@
-module Battlemap.Direction exposing (..)
+module Battlemap.Direction exposing (Direction(..), opposite_of)
type Direction =
None
@@ -6,3 +6,12 @@ type Direction =
| Right
| Up
| Down
+
+opposite_of : Direction -> Direction
+opposite_of d =
+ case d of
+ Left -> Right
+ Right -> Left
+ Up -> Down
+ Down -> Up
+ None -> None