Documentation
¶
Index ¶
Constants ¶
View Source
const ( BoardRows = 9 BoardCols = 9 BoardLevels = 3 )
View Source
const ( White color = iota Black )
View Source
const ( Setup phase = iota Prepare Play End )
View Source
const ( Marshal pieceType = iota // 帥 General // 大 LieutenantGeneral // 中 MajorGeneral // 小 Samurai // 侍 Lancer // 槍 Knight // 馬 Spy // 忍 Fortress // 砦 Pawn // 兵 Cannon // 砲 Musketeer // 筒 Archer // 弓 Captain // 謀 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Game ¶
type Game interface { // Id returns the id of the game. Id() uint // SetId sets the id of the game. SetId(id uint) // Board returns the board of the game. Board() Board // Reserve returns the reserve of the game. Reserve(color Color) PieceArea // Discard returns the discard area of the game. Discard(color Color) PieceArea // Player returns the player of the game. Player(color Color) Player // Join adds a player to the game. Join(color Color, player Player) error // Leave removes a player from the game. Leave(player Player) error // CurrentTurn returns the color of the player whose turn it is. CurrentTurn() Color // SetCurrentTurn sets the color of the player whose turn it is. SetCurrentTurn(color Color) // Phase returns the current phase of the game. Phase() Phase // SetPhase sets the current phase of the game. SetPhase(phase Phase) }
type Piece ¶
type PieceArea ¶
type PieceArea interface { // Add adds a piece to the area. Add(piece Piece) error // Remove removes a piece from the area. Remove(piece Piece) error // Contains returns whether the area contains the piece. Contains(piece Piece) bool // Pieces returns the pieces in the area. Pieces() []Piece }
func NewPieceArea ¶
func NewPieceArea() PieceArea
type PieceType ¶
type PieceType interface {
// contains filtered or unexported methods
}
func PieceTypes ¶
func PieceTypes() []PieceType
type Vector2D ¶
func NewVector2D ¶
type Vector2DImpl ¶
type Vector2DImpl struct {
// contains filtered or unexported fields
}
func (Vector2DImpl) X ¶
func (v Vector2DImpl) X() int
func (Vector2DImpl) Y ¶
func (v Vector2DImpl) Y() int
type Vector3D ¶
func NewVector3D ¶
type Vector3DImpl ¶
type Vector3DImpl struct { Vector2DImpl // contains filtered or unexported fields }
func (Vector3DImpl) Z ¶
func (v Vector3DImpl) Z() int
Source Files
¶
Click to show internal directories.
Click to hide internal directories.