From c9786fd27954c79faf901963003a8b7b3131ca4c Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 15 Sep 2017 17:41:07 +0200 Subject: Adds UI to test the Navigator. --- client/elm/battlemap/src/Battlemap/Location.elm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'client/elm/battlemap/src/Battlemap/Location.elm') 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) -- cgit v1.2.3-70-g09d2