summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-15 17:41:07 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-15 17:41:07 +0200
commitc9786fd27954c79faf901963003a8b7b3131ca4c (patch)
tree85919cf11c2e54908cfeeebe59acf03283f131c8 /client/elm/battlemap/src/Battlemap/Location.elm
parent9a2d8f37dea8e14afa57affb135def13954df547 (diff)
Adds UI to test the Navigator.
Diffstat (limited to 'client/elm/battlemap/src/Battlemap/Location.elm')
-rw-r--r--client/elm/battlemap/src/Battlemap/Location.elm6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/elm/battlemap/src/Battlemap/Location.elm b/client/elm/battlemap/src/Battlemap/Location.elm
index ffe3f0d..2fa6d5d 100644
--- a/client/elm/battlemap/src/Battlemap/Location.elm
+++ b/client/elm/battlemap/src/Battlemap/Location.elm
@@ -8,6 +8,8 @@ type alias Location =
y : Int
}
+type alias LocationComparable = (Int, Int)
+
neighbor : Location -> Direction -> Location
neighbor loc dir =
case dir of
@@ -16,3 +18,7 @@ neighbor loc dir =
Up -> {loc | y = (loc.y - 1)}
Down -> {loc | y = (loc.y + 1)}
None -> loc
+
+to_comparable : Location -> (Int, Int)
+to_comparable l =
+ (l.x, l.y)