mchess-server/chess/bishop.go

22 lines
470 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)
}