diff --git a/src/main/java/com/fathzer/jchess/generic/ChessBoard.java b/src/main/java/com/fathzer/jchess/generic/ChessBoard.java index 591978f..ea9912a 100644 --- a/src/main/java/com/fathzer/jchess/generic/ChessBoard.java +++ b/src/main/java/com/fathzer/jchess/generic/ChessBoard.java @@ -7,7 +7,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.function.Function; @@ -137,8 +136,8 @@ public DirectionExplorer getDirectionExplorer(int index) { } @Override - public List getMoves(boolean quiesce) { - return quiesce ? Collections.emptyList() : movesBuilder.getPseudoLegalMoves(); + public List getMoves() { + return movesBuilder.getPseudoLegalMoves(); } @Override diff --git a/src/test/java/com/fathzer/jchess/generic/ChessBoardTest.java b/src/test/java/com/fathzer/jchess/generic/ChessBoardTest.java index aa017b3..53ce3a0 100644 --- a/src/test/java/com/fathzer/jchess/generic/ChessBoardTest.java +++ b/src/test/java/com/fathzer/jchess/generic/ChessBoardTest.java @@ -267,7 +267,7 @@ void testZobristKey() { void pawnsMoveGenerationTest() { final ChessBoard board = (ChessBoard) FENUtils.from("r1b1k2r/1p1pqppp/2n2n1b/pP6/4QN2/B2B1P1N/P1pPP1P1/R3K2R b KQkq - 0 1"); final CoordinatesSystem cs = board.getCoordinatesSystem(); - final List blackMoves = board.getMoves(false); + final List blackMoves = board.getMoves(); assertEquals(Set.of("a4"), getTo(cs, getMoves(cs, blackMoves, "a5"))); assertEquals(Set.of("g5","g6"), getTo(cs, getMoves(cs, blackMoves, "g7"))); assertEquals(Set.of("b6"), getTo(cs, getMoves(cs, blackMoves, "b7"))); @@ -278,7 +278,7 @@ void pawnsMoveGenerationTest() { final String fen = "r1b1k2r/1p1pqppp/2n2n1b/pP6/4QN2/B2B1P1N/P1pPP1P1/R3K2R w KQkq a6 0 1"; board.copy(FENUtils.from(fen)); assertEquals(fen, FENUtils.to(board)); - final List whiteMoves = board.getMoves(false); + final List whiteMoves = board.getMoves(); assertEquals(Set.of("a6","b6","c6"), getTo(cs, getMoves(cs, whiteMoves, "b5")), asString(whiteMoves, board)); @@ -322,7 +322,7 @@ void kingsMoveGenerationTest() { assertEquals(Set.of("d1","f1"), getTo(cs ,getMoves(FENUtils.from("4k3/8/8/8/8/3n4/3PP3/4K2R w K - 0 1"), "e1")), "Problem in king move"); // Can castle - List moves = FENUtils.from("r3kb1r/ppp2ppp/2nqb2n/P2p4/2P1p3/6R1/1PQPPPPP/1NB1KBNR b Kkq - 1 8").getMoves(false); + List moves = FENUtils.from("r3kb1r/ppp2ppp/2nqb2n/P2p4/2P1p3/6R1/1PQPPPPP/1NB1KBNR b Kkq - 1 8").getMoves(); moves = moves.stream().filter(m->"e8".equals(cs.getAlgebraicNotation(m.getFrom()))).collect(Collectors.toList()); assertEquals(Set.of("c8","d8", "d7", "e7"), getTo(cs, moves)); assertEquals(4, moves.size(), asString(moves, board)); @@ -333,7 +333,7 @@ void enPassantPinned() { final Board board = FENUtils.from("2Q1B3/8/8/KP4p1/1R3pPk/5R2/4P3/8 b - g3 0 1"); List moves = board.getLegalMoves(); assertTrue(moves.isEmpty(), "Should have no legal moves but obtain "+asString(moves, board)); - moves = board.getMoves(false); + moves = board.getMoves(); assertTrue(moves.contains(move(board, "f4", "g3")), "Should contains en-passant move"); } @@ -344,7 +344,7 @@ void checkTest() { // Only king can move final Board board = FENUtils.from("r1b1k2r/1p1pqppp/2nN1n1b/pP6/4Q3/B2B1P1N/P1pPP1P1/R3K2R b KQkq - 0 1"); final CoordinatesSystem cs = board.getCoordinatesSystem(); - List moves = board.getMoves(false); + List moves = board.getMoves(); assertEquals(Set.of("e8"), getFrom(cs, moves), "Only king can move"); assertEquals(Set.of("d8", "f8"), getTo(cs, moves)); }