2023-06-20 21:53:54 +00:00
|
|
|
package chess
|
|
|
|
|
2023-06-25 14:11:29 +00:00
|
|
|
import "mchess_server/types"
|
2023-06-20 21:53:54 +00:00
|
|
|
|
|
|
|
type Rook struct {
|
2023-06-26 21:58:40 +00:00
|
|
|
Color types.ChessColor
|
2023-06-20 21:53:54 +00:00
|
|
|
}
|
|
|
|
|
2023-06-25 14:11:29 +00:00
|
|
|
func (r Rook) AfterMoveAction() {
|
2023-06-20 21:53:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2023-06-26 21:58:40 +00:00
|
|
|
return board.GetNonBlockedRowAndColumn(fromSquare)
|
2023-06-20 21:53:54 +00:00
|
|
|
}
|