types

package
v0.0.0-...-811d5cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FromPlayerMessage

type FromPlayerMessage struct {
	Type   MessageType
	Action table.Action
}

type MessageType

type MessageType int
const (
	MessageTypeUnknown MessageType = iota
	MessageTypeHello
	MessageTypeReady
	MessageTypeSitOut
	MessageTypeBuyIn
	MessageTypeTableState
	MessageTypePlayerAction
	MessageTypeIllegalAction
	MessageTypePlayerConnected
	MessageTypePlayerDisconnected
)

type Player

type Player struct {
	Id         string
	Conn       *websocket.Conn
	TablePos   int
	Ready      bool
	SittingOut bool
	Broke      bool
}

type PlayerAction

type PlayerAction struct {
	table.Action
	PlayerId string
}

type ToPlayerMessage

type ToPlayerMessage struct {
	Type         MessageType
	PlayerId     string       `json:",omitempty"`
	TableState   table.State  `json:",omitempty"`
	PlayerState  table.Player `json:",omitempty"`
	PlayerAction PlayerAction `json:",omitempty"`
	Result       string       `json:",omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL