MCPcopy Index your code
hub / github.com/coding-parrot/chess-engine / isDraw

Method isDraw

src/main/java/game/Board.java:694–703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

692 }
693
694 public boolean isDraw() {
695 if (isThreeFoldRepetition || fiftyMoveDraw) {
696 return true;
697 }
698 final List<Piece> currentPieces = playerPieces.get(playerToMove);
699 final List<Piece> opponentPieces = playerPieces.get(Color.opponent(playerToMove));
700 final boolean playerCannotWin = insufficientMaterial(currentPieces);
701 final boolean opponentCannotWin = insufficientMaterial(opponentPieces);
702 return (playerCannotWin && opponentCannotWin);
703 }
704
705 private boolean insufficientMaterial(List<Piece> opponentPieces) {
706 if (opponentPieces.size() == 1) {

Callers 2

captureAndReturnCheckMethod · 0.95
evaluationMethod · 0.95

Calls 3

opponentMethod · 0.95
insufficientMaterialMethod · 0.95
getMethod · 0.45

Tested by 1

captureAndReturnCheckMethod · 0.76