blob: f369be85605f1115ce826b727927926f621279eb (
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
38
|
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
import Struct.Player
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type))
apply_to model =
(
model,
(Action.Ports.store_params
(
(Struct.Flags.get_frequency model.flags),
(Json.Encode.encode
0
(Json.Encode.list
(List.map (Struct.Player.encode) (Array.toList model.players))
)
)
)
)
)
|