summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-07-10 22:13:48 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-07-10 22:13:48 +0200
commit7b891ce04190365080fb4ef5d8dac68528a81af1 (patch)
tree78f332b074723167bde91b46929e450c8c6049c9 /src/map-editor/src/Comm
parentf63602557a2f7320a7e02a3bf7dd9b339efaf4d1 (diff)
Still working on it...
Diffstat (limited to 'src/map-editor/src/Comm')
-rw-r--r--src/map-editor/src/Comm/LoadMap.elm (renamed from src/map-editor/src/Comm/LoadBattlemap.elm)6
-rw-r--r--src/map-editor/src/Comm/Okay.elm22
-rw-r--r--src/map-editor/src/Comm/Send.elm11
3 files changed, 26 insertions, 13 deletions
diff --git a/src/map-editor/src/Comm/LoadBattlemap.elm b/src/map-editor/src/Comm/LoadMap.elm
index cd29acf..2907f3a 100644
--- a/src/map-editor/src/Comm/LoadBattlemap.elm
+++ b/src/map-editor/src/Comm/LoadMap.elm
@@ -1,4 +1,4 @@
-module Comm.LoadBattlemap exposing (try)
+module Comm.LoadMap exposing (try)
-- Elm -------------------------------------------------------------------------
import Json.Encode
@@ -25,7 +25,7 @@ try_encoding model =
[
("stk", (Json.Encode.string model.session_token)),
("pid", (Json.Encode.string model.player_id)),
- ("bmi", (Json.Encode.string model.battlemap_id))
+ ("mix", (Json.Encode.string model.map_ix))
]
)
)
@@ -37,6 +37,6 @@ try : Struct.Model.Type -> (Maybe (Cmd Struct.Event.Type))
try model =
(Comm.Send.try_sending
model
- Constants.IO.battlemap_loading_handler
+ Constants.IO.map_loading_handler
try_encoding
)
diff --git a/src/map-editor/src/Comm/Okay.elm b/src/map-editor/src/Comm/Okay.elm
new file mode 100644
index 0000000..8ade538
--- /dev/null
+++ b/src/map-editor/src/Comm/Okay.elm
@@ -0,0 +1,22 @@
+module Comm.Okay exposing (decode)
+
+-- Elm -------------------------------------------------------------------------
+import Json.Decode
+
+-- Battlemap -------------------------------------------------------------------
+import Struct.Tile
+import Struct.ServerReply
+
+--------------------------------------------------------------------------------
+-- TYPES -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+decode : (Json.Decode.Decoder Struct.ServerReply.Type)
+decode = (Json.Decode.succeed Struct.ServerReply.Okay)
diff --git a/src/map-editor/src/Comm/Send.elm b/src/map-editor/src/Comm/Send.elm
index a6129cd..cbb6a28 100644
--- a/src/map-editor/src/Comm/Send.elm
+++ b/src/map-editor/src/Comm/Send.elm
@@ -7,13 +7,8 @@ import Json.Decode
import Json.Encode
-- Battlemap -------------------------------------------------------------------
-import Comm.AddArmor
-import Comm.AddChar
import Comm.AddTile
-import Comm.AddWeapon
import Comm.SetMap
-import Comm.SetTimeline
-import Comm.TurnResults
import Struct.Event
import Struct.ServerReply
@@ -30,12 +25,8 @@ internal_decoder : String -> (Json.Decode.Decoder Struct.ServerReply.Type)
internal_decoder reply_type =
case reply_type of
"add_tile" -> (Comm.AddTile.decode)
- "add_armor" -> (Comm.AddArmor.decode)
- "add_char" -> (Comm.AddChar.decode)
- "add_weapon" -> (Comm.AddWeapon.decode)
"set_map" -> (Comm.SetMap.decode)
- "turn_results" -> (Comm.TurnResults.decode)
- "set_timeline" -> (Comm.SetTimeline.decode)
+ "okay" -> (Comm.Okay.decode)
other ->
(Json.Decode.fail
(