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

Method placeKnight

src/main/java/game/Board.java:181–187  ·  view source on GitHub ↗
(final int row, final int col, final Color color)

Source from the content-addressed store, hash-verified

179 }
180
181 public void placeKnight(final int row, final int col, final Color color) {
182 final Cell position = Cell.get(row, col);
183 final Piece knight = Piece.get(color, position, PieceType.KNIGHT);
184 pieces.put(position, knight);
185 playerPieces.get(color).add(knight);
186 updateHashForAddition(knight);
187 }
188
189 public List<Move> getLegalMoves() {
190 final Piece king = getKing(playerToMove);

Callers 15

doubleCheckMethod · 0.95
moveForwardMethod · 0.95
moveAsKnightMethod · 0.95
blockedByPawnMethod · 0.95
blockedByEnemyPawnMethod · 0.95
notBlockedByEnemyPawnMethod · 0.95
surroundedByEnemyDiagMethod · 0.95
surroundedByTeamMethod · 0.95

Calls 4

getMethod · 0.95
getMethod · 0.95
updateHashForAdditionMethod · 0.95
getMethod · 0.45

Tested by 13

doubleCheckMethod · 0.76
moveForwardMethod · 0.76
moveAsKnightMethod · 0.76
blockedByPawnMethod · 0.76
blockedByEnemyPawnMethod · 0.76
notBlockedByEnemyPawnMethod · 0.76
surroundedByEnemyDiagMethod · 0.76
surroundedByTeamMethod · 0.76