blob: a432f3a393733308d77f9776e2b30f7cbe9e3e55 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
module Comm.SetTimeline exposing (decode)
-- Elm -------------------------------------------------------------------------
import Json.Decode
-- Battlemap -------------------------------------------------------------------
import Struct.ServerReply
import Struct.TurnResult
--------------------------------------------------------------------------------
-- TYPES -----------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
internal_decoder : (List Struct.TurnResult.Type) -> Struct.ServerReply.Type
internal_decoder trl = (Struct.ServerReply.SetTimeline trl)
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
decode : (Json.Decode.Decoder Struct.ServerReply.Type)
decode =
(Json.Decode.map
(internal_decoder)
(Json.Decode.field "cnt" (Json.Decode.list Struct.TurnResult.decoder))
)
|