summaryrefslogtreecommitdiff
blob: 6d2a65b11fa39bc5a2fd8402b4297f791bf56b17 (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
module Battlemap.Tile exposing
   (
      Type,
      TileModifier(..),
      set_direction,
      set_navigation,
      reset_tile
   )

import Battlemap.Direction
import Character

type TileModifier =
   CanBeReached
   | CanBeAttacked

type alias Type =
   {
      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
   }