Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ActionMarkLocation allows players to mark and X or O on the board
ActionMarkLocation = "MarkLocation"
)
Action types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct{}
Builder implements the bg.BoardGameBuilder interface
func (*Builder) CreateWithBGN ¶
func (b *Builder) CreateWithBGN(options *bg.BoardGameOptions) (bg.BoardGameWithBGN, error)
CreateWithBGN creates a game with BGN functionality
type MarkLocationActionDetails ¶
type MarkLocationActionDetails struct {
Row, Column int
}
MarkLocationActionDetails is the action details for marking an X or O on the board
type TicTacToe ¶
type TicTacToe struct { State *State // contains filtered or unexported fields }
TicTacToe implements the bg.BoardGame interface
func NewTicTacToe ¶
func NewTicTacToe(options *bg.BoardGameOptions) (*TicTacToe, error)
NewTicTacToe creates a new game instance
func (*TicTacToe) Do ¶
func (t *TicTacToe) Do(action *bg.BoardGameAction) error
Do performs an action on the game
func (*TicTacToe) GetSnapshot ¶
func (t *TicTacToe) GetSnapshot(team ...string) (*bg.BoardGameSnapshot, error)
GetSnapshot returns the game from team's view TicTacToe does not require hiding information from different players so everything can be returned
type TicTacToeSnapshotData ¶
type TicTacToeSnapshotData struct {
Board [size][size]string
}
TicTacToeSnapshotData is the game data unique to TicTacToe
Click to show internal directories.
Click to hide internal directories.