Zurückgenommene Züge werden korrekt angezeigt
parent
ec6f564d72
commit
9995299331
|
|
@ -173,7 +173,11 @@ public class Game {
|
||||||
Move move = new Move(origin, desination);
|
Move move = new Move(origin, desination);
|
||||||
Piece removedPiece = board.getPiece(desination);
|
Piece removedPiece = board.getPiece(desination);
|
||||||
if (removedPiece != Piece.NONE) {
|
if (removedPiece != Piece.NONE) {
|
||||||
|
int removedPiecesCount = removedPieces.size();
|
||||||
removedPieces.add(removedPiece);
|
removedPieces.add(removedPiece);
|
||||||
|
if (removedPieces.size() > removedPiecesCount + 1) {
|
||||||
|
removedPieces.removeLast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.board.doMove(move);
|
this.board.doMove(move);
|
||||||
this.movelist.add(move);
|
this.movelist.add(move);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import javax.swing.border.EmptyBorder;
|
||||||
|
|
||||||
// import de.mannheim.th.chess.App;
|
// import de.mannheim.th.chess.App;
|
||||||
import de.mannheim.th.chess.domain.Game;
|
import de.mannheim.th.chess.domain.Game;
|
||||||
import de.mannheim.th.chess.utl.OpeningRecognizer;
|
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -606,6 +606,7 @@ public class SpielFrame extends JFrame {
|
||||||
}
|
}
|
||||||
|
|
||||||
ausgabe.setText(sb.toString());
|
ausgabe.setText(sb.toString());
|
||||||
|
anzeigeMoves.removeLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
private JPanel getUiPlayerOne() {
|
private JPanel getUiPlayerOne() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue