promotion without undo
This commit is contained in:
parent
989df81c07
commit
e005026904
|
|
@ -460,6 +460,14 @@ public ArrayList<int[]> computeLegalMoves(Piece piece) {
|
|||
if (y == startRow && isEmpty(x, twoStepsY)) {
|
||||
moves.add(new int[]{x, twoStepsY});
|
||||
}
|
||||
if (nextY == 7 ){
|
||||
setPiece(false , PieceType.Queen, x,nextY);
|
||||
pieces.remove(piece);
|
||||
}
|
||||
if (nextY==0 ){
|
||||
setPiece(true , PieceType.Queen, x,nextY);
|
||||
pieces.remove(piece);
|
||||
}
|
||||
}
|
||||
|
||||
// Diagonal capture
|
||||
|
|
|
|||
Loading…
Reference in New Issue