summaryrefslogtreecommitdiff
blob: cebe76503977c669c893b33c6379929532e9f861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module Battlemap.Direction exposing (Type(..), opposite_of, to_string)

type Type =
   None
   | Left
   | Right
   | Up
   | Down

opposite_of : Type -> Type
opposite_of d =
   case d of
      Left -> Right
      Right -> Left
      Up -> Down
      Down -> Up
      None -> None

to_string : Type -> String
to_string dir =
   case dir of
      Right -> "R"
      Left -> "L"
      Up -> "U"
      Down -> "D"
      None -> "N"