summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-18 18:15:59 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-18 18:15:59 +0200
commit0b9096ed0c66db403c244a4720bac60326a40394 (patch)
tree233d01b0b04463c3c8db7e20f3c3152f73427a34 /client/elm/battlemap/src/Battlemap.elm
parentc9786fd27954c79faf901963003a8b7b3131ca4c (diff)
Character-focused navigators.
Diffstat (limited to 'client/elm/battlemap/src/Battlemap.elm')
-rw-r--r--client/elm/battlemap/src/Battlemap.elm21
1 files changed, 17 insertions, 4 deletions
diff --git a/client/elm/battlemap/src/Battlemap.elm b/client/elm/battlemap/src/Battlemap.elm
index 09b4099..d6c0017 100644
--- a/client/elm/battlemap/src/Battlemap.elm
+++ b/client/elm/battlemap/src/Battlemap.elm
@@ -1,10 +1,17 @@
-module Battlemap exposing (Battlemap, random, apply_to_tile, has_location)
+module Battlemap exposing
+ (
+ Battlemap,
+ random,
+ apply_to_tile,
+ has_location,
+ apply_to_all_tiles
+ )
-import Array exposing (Array, set, get)
+import Array exposing (Array, set, get, map)
import Battlemap.Tile exposing (Tile, generate)
-import Battlemap.Direction exposing (..)
-import Battlemap.Location exposing (..)
+import Battlemap.Direction exposing (Direction(..))
+import Battlemap.Location exposing (Location)
type alias Battlemap =
{
@@ -34,6 +41,12 @@ has_location bmap loc =
&& (loc.y < bmap.height)
)
+apply_to_all_tiles : Battlemap -> (Tile -> Tile) -> Battlemap
+apply_to_all_tiles bmap fun =
+ {bmap |
+ content = (map fun bmap.content)
+ }
+
apply_to_tile : Battlemap -> Location -> (Tile -> Tile) -> (Maybe Battlemap)
apply_to_tile bmap loc fun =
let