summaryrefslogtreecommitdiff
blob: 986cb2a40aec78cdf22081248fe11d7b3dde29fc (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module Battlemap.Tile exposing
   (
      Type,
      TileModifier(..),
      set_direction,
      set_navigation,
      reset_tile
   )

import Battlemap.Direction
import Battlemap.Location

import Character

type TileModifier =
   CanBeReached
   | CanBeAttacked

type alias Type =
   {
      location : Battlemap.Location.Ref,
      floor_level : Int,
      nav_level : Battlemap.Direction.Type,
      char_level : (Maybe Character.Ref),
      mod_level : (Maybe TileModifier)
   }

set_direction : Battlemap.Direction.Type -> Type -> Type
set_direction d t =
   {t |
      nav_level = d
   }

set_navigation : Battlemap.Direction.Type -> Type -> Type
set_navigation dir t =
   {t |
      nav_level = dir
   }

reset_tile : Type -> Type
reset_tile t =
   {t |
      nav_level = Battlemap.Direction.None,
      mod_level = Nothing
   }