From 2d20dc042a386bc9f66bc5f535403227f9acf1b1 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 22 Sep 2017 13:46:32 +0200 Subject: No more import ... exposing. It got too confusing. --- client/elm/battlemap/src/Shim/Battlemap/Tile.elm | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 client/elm/battlemap/src/Shim/Battlemap/Tile.elm (limited to 'client/elm/battlemap/src/Shim/Battlemap/Tile.elm') diff --git a/client/elm/battlemap/src/Shim/Battlemap/Tile.elm b/client/elm/battlemap/src/Shim/Battlemap/Tile.elm new file mode 100644 index 0000000..e3ab7bb --- /dev/null +++ b/client/elm/battlemap/src/Shim/Battlemap/Tile.elm @@ -0,0 +1,40 @@ +module Shim.Battlemap.Tile exposing (generate) + +import Array +import List + +import Battlemap.Direction +import Battlemap.Tile + +from_int : Int -> Battlemap.Tile.Type +from_int i = + if (i >= 10) + then + { + floor_level = (i - 10), + nav_level = Battlemap.Direction.None, + char_level = (Just (toString (i - 10))) + } + else + { + floor_level = i, + nav_level = Battlemap.Direction.None, + char_level = Nothing + } + + +generate : (Array.Array Battlemap.Tile.Type) +generate = + (Array.fromList + (List.map + (from_int) + [ + 10, 1, 1, 2, 2, 2, + 1, 0, 0, 0, 11, 2, + 1, 0, 1, 2, 0, 2, + 3, 0, 3, 4, 0, 4, + 3, 12, 0, 0, 0, 4, + 3, 3, 3, 4, 4, 4 + ] + ) + ) -- cgit v1.2.3-70-g09d2