mchess-server/chess/king.go

22 lines
442 B
Go
Raw Normal View History

package chess
2023-06-27 20:32:24 +00:00
import (
"mchess_server/types"
)
type King struct {
2023-06-27 20:32:24 +00:00
Color types.ChessColor
}
func (k King) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
return k.GetAllNonBlockedMoves(board, fromSquare)
}
func (k King) GetColor() types.ChessColor {
return k.Color
}
2023-06-27 20:32:24 +00:00
func (k King) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
return []types.Coordinate{}
}