Documentation ¶
Index ¶
Constants ¶
View Source
const ( ROWS_MAX = 6 COLUMNS_MAX = 7 )
View Source
const ( PlayerOne = 1 PlayerTwo = 2 )
View Source
const ( ScreenWidth = 640 ScreenHeight = 360 )
Variables ¶
View Source
var ( ColorRed = color.RGBA{ R: 0xFF, G: 0x00, B: 0x00, A: 0xFF, } ColorYellow = color.RGBA{ R: 0xFF, G: 0xFF, B: 0x00, A: 0xFF, } ColorBlue = color.RGBA{ R: 0x00, G: 0x00, B: 0xFF, A: 0xFF, } )
View Source
var (
ErrTerminated = errors.New("terminated")
)
Functions ¶
func GetBoardState ¶
func GetBoardState(board Board) (BoardState, []Piece)
Types ¶
type BoardState ¶
type BoardState int
const ( DrawState BoardState = -1 OngoingState BoardState = 0 PlayerOneWinState BoardState = 1 PlayerTwoWinState BoardState = 2 )
type GameState ¶
type GameState struct { Board *Board NextToPlay int BoardState BoardState }
func NewGameState ¶
func NewGameState(board *Board, boardState BoardState, nextToPlay int) *GameState
Click to show internal directories.
Click to hide internal directories.