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/Battlemap/Tile.elm | 51 ++++------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) (limited to 'client/elm/battlemap/src/Battlemap/Tile.elm') diff --git a/client/elm/battlemap/src/Battlemap/Tile.elm b/client/elm/battlemap/src/Battlemap/Tile.elm index 70268bf..dca7a64 100644 --- a/client/elm/battlemap/src/Battlemap/Tile.elm +++ b/client/elm/battlemap/src/Battlemap/Tile.elm @@ -1,55 +1,18 @@ -module Battlemap.Tile exposing (Tile, generate, set_direction) +module Battlemap.Tile exposing (Type, set_direction) -import Battlemap.Direction exposing (Direction(..)) -import Character exposing (CharacterRef) +import Battlemap.Direction +import Character -import List exposing (map) -import Array exposing (Array, fromList) -import Set exposing (Set) - -type alias Tile = +type alias Type = { floor_level : Int, - nav_level : Direction, - char_level : (Maybe CharacterRef) + nav_level : Battlemap.Direction.Type, + char_level : (Maybe Character.Ref) -- mod_level : (Set TileModifier) } -set_direction : Direction -> Tile -> Tile +set_direction : Battlemap.Direction.Type -> Type -> Type set_direction d t = {t | nav_level = d } - -from_int : Int -> Tile -from_int i = - if (i >= 10) - then - { - floor_level = (i - 10), - nav_level = None, - char_level = (Just (toString (i - 10))) - } - else - { - floor_level = i, - nav_level = None, - char_level = Nothing - } - - -generate : Int -> Int -> (Array Tile) -generate width height = - (fromList - (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