Added a List to get all Moves in ChessEngine
parent
47591a7264
commit
2dab6128b4
|
@ -9,6 +9,7 @@ import com.github.bhlangonijr.chesslib.move.Move;
|
|||
|
||||
public class ChessEngine {
|
||||
private Board board;
|
||||
private List<Move> moves = new ArrayList<>();
|
||||
|
||||
public ChessEngine() {
|
||||
board = new Board();
|
||||
|
@ -20,6 +21,7 @@ public class ChessEngine {
|
|||
Move libMove = new Move(Square.valueOf(from), Square.valueOf(to));
|
||||
if (board.legalMoves().contains(libMove)) {
|
||||
board.doMove(libMove);
|
||||
moves.add(libMove); // <-- hier merken!
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue