(Move move)
| 791 | } |
| 792 | |
| 793 | private boolean lookForChecks(Move move) { |
| 794 | final Set<Move> moveList = getMoveList(pieces.get(move.target)); |
| 795 | for (final Move possibleMove : moveList) { |
| 796 | if (possibleMove.captureMove && pieces.get(possibleMove.target).sameType(PieceType.KING)) { |
| 797 | return true; |
| 798 | } |
| 799 | } |
| 800 | final Piece king = kings[Color.opponent(playerToMove).ordinal()]; |
| 801 | return discoveredCheck(king, move.piece.position) || (move.captureMove && move.captureCell != move.target && discoveredCheck(king, move.captureCell)); |
| 802 | } |
| 803 | |
| 804 | private boolean discoveredCheck(Piece king, Cell coordinate) { |
| 805 | //knight and pawn can't give discoveries |
no test coverage detected