2021-07-22 12:44:25 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
type CmdType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ActCmd = "a"
|
|
|
|
StateCmd = "s"
|
2021-07-22 13:21:49 -04:00
|
|
|
DebugCmd = "d"
|
2021-07-22 12:44:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
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"`
|
|
|
|
}
|