mchess-server/chess/king.go

23 lines
441 B
Go

package chess
import "local/m/mchess_server/types"
type King struct {
Color types.ChessColor
HasMoved bool
}
// AfterMoveAction implements Piece.
func (k King) AfterMoveAction() {
k.HasMoved = true
}
// GetColor implements Piece.
func (k King) GetColor() types.ChessColor {
return k.Color
}
func (k King) GetAllLegalAndIllegalMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
return []types.Coordinate{}
}