24 lines
549 B
Go
24 lines
549 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.GetAllNonBlockedMoves(board, fromSquare)
|
|
}
|
|
|
|
func (b Bishop) GetColor() types.ChessColor {
|
|
return b.Color
|
|
}
|
|
|
|
func (b Bishop) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return board.GetNonBlockedDiagonals(fromSquare)
|
|
}
|
|
|
|
func (b Bishop) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}
|