summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'client/elm/battlemap/src/Battlemap/Location.elm')
-rw-r--r-- | client/elm/battlemap/src/Battlemap/Location.elm | 6 |
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) |