(int row, int col, Color color,
Reference<Piece> blockingPiece, Map<Piece, Piece> blockingChecks,
PieceType... attackerTypes)
| 330 | } |
| 331 | |
| 332 | public boolean stopFindingPin(int row, int col, Color color, |
| 333 | Reference<Piece> blockingPiece, Map<Piece, Piece> blockingChecks, |
| 334 | PieceType... attackerTypes) { |
| 335 | if (!isEmpty(row, col)) { |
| 336 | final Piece piece = getPiece(row, col); |
| 337 | if (blockingPiece.object == null) { |
| 338 | if (piece.color == color) { |
| 339 | blockingPiece.object = piece; |
| 340 | return false; |
| 341 | } else { |
| 342 | return true; |
| 343 | } |
| 344 | } else { |
| 345 | if (piece.color != color && Arrays.stream(attackerTypes).anyMatch(piece::sameType)) { |
| 346 | blockingChecks.put(blockingPiece.object, piece); |
| 347 | } |
| 348 | return true; |
| 349 | } |
| 350 | } |
| 351 | return false; |
| 352 | } |
| 353 | |
| 354 | private Set<Piece> attackingKing(Piece king) { |
| 355 | final HashSet<Piece> attackers = new HashSet<>(); |
no test coverage detected