summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-05-03 17:23:24 +0200
committernsensfel <SpamShield0@noot-noot.org>2019-05-03 17:23:24 +0200
commitc14e56360447d5581913d5a535b0540378f04a04 (patch)
tree1db4c28de2df71bc575b8a2704551a2b72e7d25d /src/shared/battle-map
parent5b60ea80b8e3f4c0fcfe8764f37e54a8e6f4d9bb (diff)
Adds partial Marker edition (no permissions yet).
Diffstat (limited to 'src/shared/battle-map')
-rw-r--r--src/shared/battle-map/BattleMap/Struct/Map.elm4
-rw-r--r--src/shared/battle-map/BattleMap/Struct/Marker.elm4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/battle-map/BattleMap/Struct/Map.elm b/src/shared/battle-map/BattleMap/Struct/Map.elm
index 97f0ae8..fb3f8fb 100644
--- a/src/shared/battle-map/BattleMap/Struct/Map.elm
+++ b/src/shared/battle-map/BattleMap/Struct/Map.elm
@@ -5,6 +5,7 @@ module BattleMap.Struct.Map exposing
empty,
get_height,
get_markers,
+ set_markers,
get_movement_cost_function,
get_omnimods_at,
get_tiles,
@@ -76,6 +77,9 @@ get_tiles map = map.content
get_markers : Type -> (Dict.Dict String BattleMap.Struct.Marker.Type)
get_markers map = map.markers
+set_markers : (Dict.Dict String BattleMap.Struct.Marker.Type) -> Type -> Type
+set_markers markers map = {map | markers = markers}
+
set_tile_to : BattleMap.Struct.Location.Type -> BattleMap.Struct.TileInstance.Type -> Type -> Type
set_tile_to loc tile_inst map =
{map |
diff --git a/src/shared/battle-map/BattleMap/Struct/Marker.elm b/src/shared/battle-map/BattleMap/Struct/Marker.elm
index 9af3ece..2493b5e 100644
--- a/src/shared/battle-map/BattleMap/Struct/Marker.elm
+++ b/src/shared/battle-map/BattleMap/Struct/Marker.elm
@@ -3,6 +3,7 @@ module BattleMap.Struct.Marker exposing
Type,
new,
get_locations,
+ set_locations,
is_in_locations,
decoder,
encode
@@ -44,6 +45,9 @@ new =
get_locations : Type -> (Set.Set BattleMap.Struct.Location.Ref)
get_locations marker = marker.locations
+set_locations : (Set.Set BattleMap.Struct.Location.Ref) -> Type -> Type
+set_locations locations marker = {marker | locations = locations}
+
is_in_locations : BattleMap.Struct.Location.Ref -> Type -> Bool
is_in_locations loc_ref marker =
(Set.member loc_ref marker.locations)