-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.fs
63 lines (46 loc) · 13 KB
/
Program.fs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
open System
open Fable.Import
open Fable.Core
open Elmish
open ModelsCommon
open ModelsClient
// This could come from a json file
let spriteLoadInfos =
[ { Name = "Penguin"
Width = 64
Height = 64
Layers =
[ 0, Default, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAAK/INwWK6QAAD+VJREFUeNrdmwdUFdcWhgcuXToiKApobIgFG1HkgV1RUAN2QaMvtjxLVOyJSdRETUw0xhjxJYjYEVssUSPYxUboRXoRQSygUqX8b+/hXkPuuvgURL05a31rmLnDnPP/Z8/MaSO8haRP2BJ2UloREuIfn/paWVn59+nTJ27MmDGPx44dW0zb4oEDBz5o3bp1CP2+nLD+Jwp/z9TU9PiMGTMQGBiI69evIzQ0VOTWrVsiJ06cwIoVK9CqVatsOn8RofVPEd/KzMwsadWqVQgICMDu3bvh7+8PPz+/6ojH9u7diy1btqBjx46g/9tLGCm7eFXi1LBhw7BmzRp8/vnnMri2n/PZZ589Z+XKlZg5cyY0NDTYBD9CW6nveRUVFbi5uWHy5MmYNGkSJk6c+De8vLye4+npKW7Hjx8PQ0NDNoDxUmYDVhFo3749+vbti969e4s4Ozv/DScnJxni/vvvvw91dXWZAZeJRspqwHECmpqasLa2RsuWLfHee+9BnhYtWjynefPm0NfXZ+EyiglXZRSvSYQSkMH3dYMGDaojHpNIJFzj4lZVVZXPlec7ZXwr6BLpBBo2bIjBgwdzFMgLEyNg48aNOHr0KBYuXMimKDLgLGGhbAboEVlqamriO57TnTt3YGdn91yYubk5YmNjUT19/fXXigxIJOyUzQB94m6vXr2Qm5srmnD//n2xIcRvBha2dOlScAoPD8fly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fun info -> info.Name, info)
|> Map.ofList
let start() =
let subscribe, dispatch =
let update = Event<_>()
// Connect to the server and wait for messages.
//let webSocket = Browser.WebSocket.Create("")
// Outgoing messages.
let serverRequest = fun _ -> ignore() // fun (m : ServerRequest) -> m |> Serialize.toJson |> webSocket.send
// Create the program.
let program =
Program.mkProgram State.init (State.update serverRequest) (fun _ _ -> ignore())
//|> Program.withConsoleTrace
let dispatch = Program.run update.Trigger program
// Incoming messages.
// webSocket.onmessage <- fun message ->
// unbox message.data
// |> Serialize.ofJson
// |> FromServer
// |> dispatch
// obj()
update.Publish.Add, dispatch
GameWorldRenderer.create subscribe dispatch spriteLoadInfos (Browser.document.getElementById("GameWorld"))
HudRenderer.create subscribe dispatch (Browser.document.getElementById("Hud"))
AddItem "Penguin" |> dispatch
AddItem "Fable" |> dispatch
Advance |> dispatch
Browser.window.addEventListener("DOMContentLoaded", U2.Case1(Func<_,_>(fun _ -> start())))