Documentation ¶
Index ¶
- Variables
- func NewBoard(tileSet tilesets.TileSet) elements.Board
- type Game
- func (game *Game) CanSwapTiles() bool
- func (game *Game) CurrentPlayer() elements.Player
- func (game Game) DeepClone() *Game
- func (game *Game) DeepCloneWithLog(log logger.Logger) (*Game, error)
- func (game *Game) DeepCloneWithSwappableTiles() *Game
- func (game *Game) Finalize() (elements.ScoreReport, error)
- func (game *Game) GetCurrentTile() (tiles.Tile, error)
- func (game *Game) GetLegalMovesFor(placement elements.PlacedTile) []elements.PlacedTile
- func (game *Game) GetMidGameScore() elements.ScoreReport
- func (game *Game) GetRemainingTiles() []tiles.Tile
- func (game *Game) GetTilePlacementsFor(tile tiles.Tile) []elements.PlacedTile
- func (game *Game) PlayTurn(move elements.PlacedTile) error
- func (game *Game) PlayerCount() int
- func (game *Game) Serialized() SerializedGame
- func (game *Game) SwapCurrentTile(tile tiles.Tile) error
- type SerializedGame
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotSwapTiles = errors.New(
"swapping tiles is only allowed in game clones created with DeepCloneWithSwappableTiles()",
)
Functions ¶
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func NewFromTileSet ¶
func (*Game) CanSwapTiles ¶
func (*Game) CurrentPlayer ¶
func (*Game) DeepCloneWithLog ¶
func (*Game) DeepCloneWithSwappableTiles ¶
func (*Game) GetLegalMovesFor ¶
func (game *Game) GetLegalMovesFor(placement elements.PlacedTile) []elements.PlacedTile
func (*Game) GetMidGameScore ¶
func (game *Game) GetMidGameScore() elements.ScoreReport
Calculate points as if game has just finished
func (*Game) GetRemainingTiles ¶
func (*Game) GetTilePlacementsFor ¶
func (game *Game) GetTilePlacementsFor(tile tiles.Tile) []elements.PlacedTile
func (*Game) PlayerCount ¶
func (*Game) Serialized ¶
func (game *Game) Serialized() SerializedGame
type SerializedGame ¶
type SerializedGame struct { CurrentTile tiles.Tile ValidTilePlacements []elements.PlacedTile CurrentPlayerID elements.ID Players []elements.SerializedPlayer PlayerCount int Tiles []elements.PlacedTile TileSet tilesets.TileSet BinaryTiles []binarytiles.BinaryTile // contains info about all placed tiles, not placed tiles are equal to 0 }
Click to show internal directories.
Click to hide internal directories.