25 lines
502 B
Go
25 lines
502 B
Go
package chess
|
|
|
|
import (
|
|
"mchess_server/types"
|
|
)
|
|
|
|
type Rook struct {
|
|
Color types.ChessColor
|
|
}
|
|
|
|
func (r Rook) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return r.GetAllNonBlockedMoves(board, fromSquare)
|
|
}
|
|
|
|
func (r Rook) AfterMoveAction() {
|
|
}
|
|
|
|
func (r Rook) GetColor() types.ChessColor {
|
|
return r.Color
|
|
}
|
|
|
|
func (r Rook) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return board.GetNonBlockedRowAndColumn(fromSquare)
|
|
}
|