summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-02-25 18:50:51 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-02-25 18:50:51 +0100 |
commit | 12f4b4b01426871577c620df6060c946866131a4 (patch) | |
tree | 640b3fff4b7638ab56d9bd11b8c198c019ea57ef /src/map-editor/src/Comm | |
parent | 06b345326f21c3c6fec602df9b67374e922ba6ac (diff) |
[Broken] Working on set_map...
Diffstat (limited to 'src/map-editor/src/Comm')
-rw-r--r-- | src/map-editor/src/Comm/SetMap.elm | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src/map-editor/src/Comm/SetMap.elm b/src/map-editor/src/Comm/SetMap.elm index 5d778d6..62e33a4 100644 --- a/src/map-editor/src/Comm/SetMap.elm +++ b/src/map-editor/src/Comm/SetMap.elm @@ -12,17 +12,11 @@ import Struct.Map import Struct.MapMarker import Struct.ServerReply import Struct.Tile +import Struct.TileInstance -------------------------------------------------------------------------------- -- TYPES ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -type alias MapData = - { - w : Int, - h : Int, - t : (List (List String)), - m : (Dict.Dict String Struct.MapMarker.Type) - } -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -77,39 +71,12 @@ deserialize_tile_instance map_width index t = [] ) -internal_decoder : MapData -> Struct.ServerReply.Type -internal_decoder map_data = - (Struct.ServerReply.SetMap - (Struct.Map.new - map_data.w - map_data.h - (List.indexedMap - (deserialize_tile_instance map_data.w) - map_data.t - ) - ) - ) - -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- decode : (Json.Decode.Decoder Struct.ServerReply.Type) decode = (Json.Decode.map - internal_decoder - (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)) - ) - ) - ) + (\map -> (Struct.ServerReply.SetMap map)) + (Struct.Map.decoder) ) |