diff --git a/OOP_3B5_Project/src/backend/Board.java b/OOP_3B5_Project/src/backend/Board.java index 8cd21a7..9ce9c2b 100644 --- a/OOP_3B5_Project/src/backend/Board.java +++ b/OOP_3B5_Project/src/backend/Board.java @@ -1,6 +1,7 @@ package backend; import java.util.ArrayList; +import java.util.HashMap; // for unddolastmove public class Board { private int column; // constructors for column and line @@ -11,7 +12,7 @@ public class Board { private int selectX = -1; private int selectY = -1; private Move move; - private int zero = -1; + private HashMap> boardHistory; // hashmap for undolastmove //initiation of the board, creating an 8 * 8 grid public Board(int colNum, int lineNum) { @@ -19,6 +20,7 @@ public class Board { this.line = lineNum; this.pieces = new ArrayList<>(); this.move = new Move(pieces, this); //adding an acces to Move methods and linkking the arraylist to the class methods + this.boardHistory = new HashMap<>(); //for history of the board an make undolastmove possible, acts like a dictionnary in python } @@ -37,10 +39,6 @@ public class Board { public void setTurnNb(int turnNb) { this.turnNb = turnNb; } - - public int getZero() { - return this.zero; - } public boolean isTurnWhite() { if (turnNb % 2 == 0){