summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battle/src/Comm')
-rw-r--r-- | src/battle/src/Comm/AddChar.elm | 9 | ||||
-rw-r--r-- | src/battle/src/Comm/SetMap.elm | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/battle/src/Comm/AddChar.elm b/src/battle/src/Comm/AddChar.elm index 32227a8..184c588 100644 --- a/src/battle/src/Comm/AddChar.elm +++ b/src/battle/src/Comm/AddChar.elm @@ -5,6 +5,8 @@ import Json.Decode -- Map ------------------------------------------------------------------- import Struct.Character +import Struct.Weapon +import Struct.Armor import Struct.ServerReply -------------------------------------------------------------------------------- @@ -16,7 +18,12 @@ import Struct.ServerReply -------------------------------------------------------------------------------- internal_decoder : ( - (Struct.Character.Type, Int, Int, Int) -> + ( + Struct.Character.Type, + Struct.Weapon.Ref, + Struct.Weapon.Ref, + Struct.Armor.Ref + ) -> Struct.ServerReply.Type ) internal_decoder char_and_refs = (Struct.ServerReply.AddCharacter char_and_refs) diff --git a/src/battle/src/Comm/SetMap.elm b/src/battle/src/Comm/SetMap.elm index d26ca74..81a4a73 100644 --- a/src/battle/src/Comm/SetMap.elm +++ b/src/battle/src/Comm/SetMap.elm @@ -17,14 +17,14 @@ type alias MapData = { w : Int, h : Int, - t : (List (List Int)) + t : (List (List String)) } -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- deserialize_tile_borders : ( - (List Int) -> + (List String) -> (List Struct.Tile.Border) -> (List Struct.Tile.Border) ) @@ -39,7 +39,7 @@ deserialize_tile_borders rem_ints current_borders = _ -> [] -deserialize_tile_instance : Int -> Int -> (List Int) -> Struct.Tile.Instance +deserialize_tile_instance : Int -> Int -> (List String) -> Struct.Tile.Instance deserialize_tile_instance map_width index t = case t of (a :: (b :: c)) -> @@ -60,8 +60,8 @@ deserialize_tile_instance map_width index t = x = (index % map_width), y = (index // map_width) } - 0 - 0 + "0" + "0" Constants.Movement.cost_when_out_of_bounds [] ) @@ -91,7 +91,7 @@ decode = (Json.Decode.field "h" Json.Decode.int) (Json.Decode.field "t" - (Json.Decode.list (Json.Decode.list Json.Decode.int)) + (Json.Decode.list (Json.Decode.list Json.Decode.string)) ) ) ) |