24 lines
553 B
Go
24 lines
553 B
Go
package chess
|
|
|
|
import (
|
|
"mchess_server/types"
|
|
)
|
|
|
|
type Bishop struct {
|
|
Color types.ChessColor
|
|
}
|
|
|
|
func (b Bishop) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return b.GetAllNonBlockedSquares(board, fromSquare)
|
|
}
|
|
|
|
func (b Bishop) GetColor() types.ChessColor {
|
|
return b.Color
|
|
}
|
|
|
|
func (b Bishop) GetAllNonBlockedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return board.GetNonBlockedDiagonals(fromSquare)
|
|
}
|
|
|
|
func (b Bishop) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}
|