summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-02-18 22:06:24 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-02-18 22:06:24 +0100
commit06b345326f21c3c6fec602df9b67374e922ba6ac (patch)
tree2bfd6047e1696c5164b397d7f09996e343e9f7da /src/map-editor/src/Comm
parent265bdd2efca3ea4e94087bee2f55d05527beb2f0 (diff)
...
Diffstat (limited to 'src/map-editor/src/Comm')
-rw-r--r--src/map-editor/src/Comm/SetMap.elm15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/map-editor/src/Comm/SetMap.elm b/src/map-editor/src/Comm/SetMap.elm
index 5fceea5..5d778d6 100644
--- a/src/map-editor/src/Comm/SetMap.elm
+++ b/src/map-editor/src/Comm/SetMap.elm
@@ -1,12 +1,15 @@
module Comm.SetMap exposing (decode)
-- Elm -------------------------------------------------------------------------
+import Dict
+
import Json.Decode
-- Map -------------------------------------------------------------------------
import Constants.Movement
import Struct.Map
+import Struct.MapMarker
import Struct.ServerReply
import Struct.Tile
@@ -18,7 +21,7 @@ type alias MapData =
w : Int,
h : Int,
t : (List (List String)),
- m : (Dict.Dict String (List Struct.Location.Type))
+ m : (Dict.Dict String Struct.MapMarker.Type)
}
--------------------------------------------------------------------------------
@@ -94,13 +97,19 @@ decode : (Json.Decode.Decoder Struct.ServerReply.Type)
decode =
(Json.Decode.map
internal_decoder
- (Json.Decode.map3
- MapData
+ (Json.Decode.map4 MapData
(Json.Decode.field "w" Json.Decode.int)
(Json.Decode.field "h" Json.Decode.int)
(Json.Decode.field
"t"
(Json.Decode.list (Json.Decode.list Json.Decode.string))
)
+ (Json.Decode.field
+ "m"
+ (Json.Decode.map
+ (Dict.fromList)
+ (Json.Decode.keyValuePairs (Struct.MapMarker.decoder))
+ )
+ )
)
)