mchess-server/chess/rook.go

19 lines
347 B
Go
Raw Normal View History

package chess
2023-06-25 14:11:29 +00:00
import "mchess_server/types"
type Rook struct {
Color types.ChessColor
}
2023-06-25 14:11:29 +00:00
func (r Rook) AfterMoveAction() {
}
func (r Rook) GetColor() types.ChessColor {
return r.Color
}
2023-06-25 14:11:29 +00:00
func (r Rook) GetAllMovesButBlocked(board Board, fromSquare types.Coordinate) []types.Coordinate {
return board.GetNonBlockedRowAndColumn(fromSquare)
}