blob: cad07e6f800bd50f61045b67d557c25467822a9c (
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
28
29
30
31
32
33
34
35
36
37
|
module Update.StoreParams exposing (apply_to)
-- Elm -------------------------------------------------------------------------
import Array
import Json.Encode
-- Extension -------------------------------------------------------------------
import Action.Ports
import Struct.Event
import Struct.Flags
import Struct.Model
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type))
apply_to model =
(
model,
(Action.Ports.set_params
(Json.Encode.encode
0
(Struct.Flags.encode
(Struct.Flags.set_players
(Array.toList model.players)
model.flags
)
)
)
)
)
|