Merge branch 'master' of https://gitarero.ecam.fr/aurele.wittke/OOP_1A5_Project
This commit is contained in:
commit
07a828920e
|
|
@ -25,7 +25,9 @@ public class Board {
|
||||||
private boolean castling;
|
private boolean castling;
|
||||||
private boolean castlingDone;
|
private boolean castlingDone;
|
||||||
private ArrayList<String> previousBoard;
|
private ArrayList<String> previousBoard;
|
||||||
private ArrayList<Piece> altPieces;
|
private ArrayList<Piece> altPieces;
|
||||||
|
|
||||||
|
private boolean isChecked;
|
||||||
|
|
||||||
public Board(int colNum, int lineNum) {
|
public Board(int colNum, int lineNum) {
|
||||||
this.kingWMoved = false;
|
this.kingWMoved = false;
|
||||||
|
|
@ -667,6 +669,12 @@ public class Board {
|
||||||
}
|
}
|
||||||
nbOccupied = 0;
|
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
|
if (pieces.get(indexPieceSelect).getType() == PieceType.Knight) { //highlight for knights
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue