Merge branch 'master' of
https://gitarero.ecam.fr/keshini.nistar/OOP_Groupe_1A3_Project.git
This commit is contained in:
parent
59569de160
commit
df56940b07
|
|
@ -165,7 +165,7 @@ public class Board {
|
||||||
if(chosenPiece.getType()==PieceType.Pawn) {
|
if(chosenPiece.getType()==PieceType.Pawn) {
|
||||||
movementSuccess=movement.movePawn(x,y);
|
movementSuccess=movement.movePawn(x,y);
|
||||||
|
|
||||||
if(!movementSuccess) {
|
if(!movementSuccess) { //in case the initial pawn move fails or cannot be done, enPassant is checked
|
||||||
MovementCapabilities specialMoves= new MovementCapabilities();
|
MovementCapabilities specialMoves= new MovementCapabilities();
|
||||||
movementSuccess= specialMoves.enPassant(chosenPiece, x, y, this);
|
movementSuccess= specialMoves.enPassant(chosenPiece, x, y, this);
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +176,7 @@ public class Board {
|
||||||
}else if (chosenPiece.getType()==PieceType.King) {
|
}else if (chosenPiece.getType()==PieceType.King) {
|
||||||
movementSuccess=movement.moveKing(x, y);
|
movementSuccess=movement.moveKing(x, y);
|
||||||
|
|
||||||
if(!movementSuccess) {
|
if(!movementSuccess) { //in case the initial pawn move fails or cannot be done, castling is checked
|
||||||
MovementCapabilities specialMoves=new MovementCapabilities();
|
MovementCapabilities specialMoves=new MovementCapabilities();
|
||||||
movementSuccess= specialMoves.castling(chosenPiece, x, y, this);
|
movementSuccess= specialMoves.castling(chosenPiece, x, y, this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue