2023-06-20 21:53:54 +00:00
|
|
|
package chess
|
|
|
|
|
2023-06-27 20:32:24 +00:00
|
|
|
import (
|
|
|
|
"mchess_server/types"
|
|
|
|
)
|
2023-06-20 21:53:54 +00:00
|
|
|
|
|
|
|
type Bishop struct {
|
|
|
|
Color types.ChessColor
|
|
|
|
}
|
|
|
|
|
2023-06-27 20:32:24 +00:00
|
|
|
func (b Bishop) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
|
|
return b.GetAllNonBlockedMoves(board, fromSquare)
|
|
|
|
}
|
|
|
|
|
2023-06-20 21:53:54 +00:00
|
|
|
func (b Bishop) GetColor() types.ChessColor {
|
|
|
|
return b.Color
|
|
|
|
}
|
|
|
|
|
2023-06-27 20:32:24 +00:00
|
|
|
func (b Bishop) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
2023-06-27 21:47:24 +00:00
|
|
|
return board.GetNonBlockedDiagonals(fromSquare)
|
2023-06-20 21:53:54 +00:00
|
|
|
}
|
2023-07-05 19:15:01 +00:00
|
|
|
|
|
|
|
func (b Bishop) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}
|