This commit is contained in:
edwin 2025-05-16 11:24:13 +02:00
commit 07a828920e
2 changed files with 30 additions and 1 deletions

View File

@ -25,7 +25,9 @@ public class Board {
private boolean castling;
private boolean castlingDone;
private ArrayList<String> previousBoard;
private ArrayList<Piece> altPieces;
private ArrayList<Piece> 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

21
src/backend/Check.java Normal file
View File

@ -0,0 +1,21 @@
package backend;
import backend.Board;
import java.util.ArrayList;
import java.lang.Math;
public class Check {
private ArrayList<Piece> altPieces ;
//in Board, add a boolean isChecked ?
public Check (ArrayList<Piece> pieces) {
altPieces = pieces;
}
}