13 lines
306 B
Elm
13 lines
306 B
Elm
module Go.Ws exposing (..)
|
|
import Go.Types exposing (..)
|
|
import WebSocket
|
|
|
|
encodeCell : Cell -> String
|
|
encodeCell ((x, y), c) = "place "
|
|
++ (toString x) ++ " "
|
|
++ (toString y) ++ " "
|
|
++ (toString c)
|
|
|
|
sendMove : Model -> Cell -> Cmd Msg
|
|
sendMove m c = WebSocket.send m.sessionUrl (encodeCell c)
|