GoUI/Go/Ws.elm

13 lines
306 B
Elm
Raw Normal View History

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)