snengame/cmd.go

24 lines
476 B
Go
Raw Normal View History

package main
type CmdType string
const (
ActCmd = "a"
StateCmd = "s"
2021-07-22 13:21:49 -04:00
DebugCmd = "d"
)
type Command struct {
PlayerID int `json:"player_id"`
Type CmdType `json:"type"`
Cmd string `json:"cmd"`
}
2021-07-22 13:09:56 -04:00
type CommandResult struct {
PlayerID int `json:"player_id"`
ResultType CmdType `json:"result_type"`
StateResult *GameView `json:"state_result"`
ActionResult []Card `json:"action_result"`
DebugResult *Game `json:"debug_result"`
}