diff --git a/OOP_2B1_Project/src/backend/Board.java b/OOP_2B1_Project/src/backend/Board.java index 42c57a6..c03cee6 100644 --- a/OOP_2B1_Project/src/backend/Board.java +++ b/OOP_2B1_Project/src/backend/Board.java @@ -1,7 +1,7 @@ package backend; import java.util.ArrayList; -import java.util.List; +import java.util.LinkedList; public class Board { @@ -240,23 +240,23 @@ private ArrayList highlightedPositions = new ArrayList<>(); -public List getAllLegalMoves(boolean isWhite) { - List moves = new ArrayList<>(); +public LinkedList getAllLegalMoves(boolean isWhite) { + LinkedList moves = new LinkedList<>(); for (int row = 0; row < 8; row++) { for (int col = 0; col < 8; col++) { Piece piece = getPieceAt(row, col); if (piece != null && piece.isWhite() == isWhite) { - List pieceMoves = piece.getLegalMoves(this, row, col); // This method must exist in Piece - moves.addAll(pieceMoves); + //LinkedList pieceMoves = piece.getLegalMoves(this, row, col); // This method must exist in Piece + //moves.addAll(pieceMoves); } } } return moves; } -public List getAllPieces() { - List pieces = new ArrayList<>(); +public LinkedList getAllPieces() { + LinkedList pieces = new LinkedList<>(); for (int row = 0; row < 8; row++) { for (int col = 0; col < 8; col++) {