diff --git a/src/backend/Board.java b/src/backend/Board.java index c64cf44..bf1a724 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -25,7 +25,9 @@ public class Board { private boolean castling; private boolean castlingDone; private ArrayList previousBoard; - private ArrayList altPieces; + private ArrayList altPieces; + + private boolean isChecked; public Board(int colNum, int lineNum) { this.kingWMoved = false; @@ -667,6 +669,12 @@ public class Board { } nbOccupied = 0; } + + /*altPieces = pieces; //create a copy of pieces that we will modify to check if the movement leaves the king in check + if (highlight) { + altPieces.get(whatPiece(this.x,this.y)).setX(x); + altPieces.get(whatPiece(this.x,this.y)).setY(y); + }*/ } if (pieces.get(indexPieceSelect).getType() == PieceType.Knight) { //highlight for knights diff --git a/src/backend/Check.java b/src/backend/Check.java new file mode 100644 index 0000000..13631eb --- /dev/null +++ b/src/backend/Check.java @@ -0,0 +1,21 @@ +package backend; +import backend.Board; + +import java.util.ArrayList; +import java.lang.Math; + +public class Check { + private ArrayList altPieces ; + //in Board, add a boolean isChecked ? + + public Check (ArrayList pieces) { + altPieces = pieces; + } + + + + + + + +}