Zurückgenommene Züge werden korrekt angezeigt

openingRecognition
Marius Gündel 2025-06-29 17:27:02 +02:00
parent ec6f564d72
commit 9995299331
3 changed files with 5 additions and 1 deletions

View File

@ -173,7 +173,11 @@ public class Game {
Move move = new Move(origin, desination);
Piece removedPiece = board.getPiece(desination);
if (removedPiece != Piece.NONE) {
int removedPiecesCount = removedPieces.size();
removedPieces.add(removedPiece);
if (removedPieces.size() > removedPiecesCount + 1) {
removedPieces.removeLast();
}
}
this.board.doMove(move);
this.movelist.add(move);

View File

@ -9,7 +9,6 @@ import javax.swing.border.EmptyBorder;
// import de.mannheim.th.chess.App;
import de.mannheim.th.chess.domain.Game;
import de.mannheim.th.chess.utl.OpeningRecognizer;
import javax.swing.JLabel;

View File

@ -606,6 +606,7 @@ public class SpielFrame extends JFrame {
}
ausgabe.setText(sb.toString());
anzeigeMoves.removeLast();
}
private JPanel getUiPlayerOne() {