Documentation ¶
Index ¶
- type Game
- func (g *Game) CurrentPlayer() *player.Player
- func (g *Game) IsTurnOf(p *player.Player) bool
- func (g *Game) Join(w http.ResponseWriter, r *http.Request, name string, user *httpauth.UserData) bool
- func (g *Game) JoinAi(ai settings.AiConfig) bool
- func (g *Game) JoinKibitz(conn *websocket.Conn, name string, user *httpauth.UserData) bool
- func (g *Game) JoinWs(conn *websocket.Conn, name string, user *httpauth.UserData, bot bool) bool
- func (g *Game) NextPlayer() *player.Player
- func (g *Game) SwitchPlayers()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { ID string Players []*player.Player CurrentPlayerIndex int // contains filtered or unexported fields }
Game is a struct that represents the state and connections of a multiplayer ban qi game that the server is hosting.
func (*Game) CurrentPlayer ¶
func (*Game) Join ¶
func (g *Game) Join(w http.ResponseWriter, r *http.Request, name string, user *httpauth.UserData) bool
Join causes a connection to join a game as a websocket and player
func (*Game) JoinKibitz ¶
JoinKibitz will create a new 'player' and add to the group of kibitzers in a game
func (*Game) NextPlayer ¶
func (*Game) SwitchPlayers ¶
func (g *Game) SwitchPlayers()
Click to show internal directories.
Click to hide internal directories.