| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'client/elm/battlemap/src/Battlemap.elm')
| -rw-r--r-- | client/elm/battlemap/src/Battlemap.elm | 19 | 
1 files changed, 19 insertions, 0 deletions
diff --git a/client/elm/battlemap/src/Battlemap.elm b/client/elm/battlemap/src/Battlemap.elm index d6c0017..ef24c80 100644 --- a/client/elm/battlemap/src/Battlemap.elm +++ b/client/elm/battlemap/src/Battlemap.elm @@ -3,6 +3,7 @@ module Battlemap exposing        Battlemap,        random,        apply_to_tile, +      apply_to_tile_unsafe,        has_location,        apply_to_all_tiles     ) @@ -67,3 +68,21 @@ apply_to_tile bmap loc fun =                       )                 }              ) + +apply_to_tile_unsafe : Battlemap -> Location -> (Tile -> Tile) -> Battlemap +apply_to_tile_unsafe bmap loc fun = +   let +      index = (location_to_index bmap loc) +      at_index = (get index bmap.content) +   in +      case at_index of +         Nothing -> bmap +         (Just tile) -> +            {bmap | +               content = +                  (set +                     index +                     (fun tile) +                     bmap.content +                  ) +            }  | 


