castling can be undone et redo, but only for the concerned castle, the
king will still move and the castlking variable for the other type of castle will get + 1, still an improvement
This commit is contained in:
parent
a37a1a8d76
commit
c7d7991a16
|
|
@ -279,6 +279,7 @@ public class Board {
|
|||
pieces.clear(); // removes all pieces from arraylist of pieces used
|
||||
pieces.addAll(previousState); // add all pieces from previous state of board to arraylist
|
||||
boardHistory.remove(turnNb + 1);
|
||||
move.moveResetCastlingVar(turnNb);
|
||||
|
||||
}else if (turnNb == 1) {
|
||||
turnNb--;
|
||||
|
|
@ -286,6 +287,8 @@ public class Board {
|
|||
boardHistory.clear();
|
||||
populateBoard();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -393,7 +393,9 @@ public boolean isKingMoveValid(int x, int y, boolean color, int selectX, int se
|
|||
}
|
||||
|
||||
|
||||
|
||||
public void moveResetCastlingVar(int turnNb) {
|
||||
specialMoves.resetCastlingVar(turnNb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue