isSquareAttackedBy

fun isSquareAttackedBy(square: Square, attackerColor: PieceColor, board: Board): Boolean

Determines if a square is attacked by any piece of attackerColor on the board.

Return

True if the square is attacked, false otherwise.

Parameters

square

The square to check.

attackerColor

The color of the potential attackers.

board

The board to check on.