doppelte Methoden vom merge gelöst
parent
8be6bc3112
commit
346b413a7d
|
|
@ -272,15 +272,11 @@ public class Game {
|
||||||
return board.getFen();
|
return board.getFen();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Square getSelectedSquare() {
|
// public Square getSelectedSquare() {
|
||||||
return this.getSelectedSquare();
|
// return this.getSelectedSquare();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getUnicodeFromMove(Move move) {
|
public String getUnicodeFromMove(Move move) {
|
||||||
return board.getPiece(move.getTo()).getFanSymbol().toUpperCase();
|
return board.getPiece(move.getTo()).getFanSymbol().toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Square getSelectedSquare() {
|
|
||||||
return this.getSelectedSquare();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -271,34 +271,6 @@ public class SpielFrame extends JFrame {
|
||||||
// frame.setVisible(true);
|
// frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int showPromotion() {
|
|
||||||
final int[] result = { -1 };
|
|
||||||
|
|
||||||
JDialog dialog = new JDialog(this, "Wähle eine Figur", true);
|
|
||||||
dialog.setLayout(new GridLayout(2, 2));
|
|
||||||
dialog.setSize(300, 200);
|
|
||||||
|
|
||||||
int[] pictures = { 81, 82, 66, 78, 113, 114, 98, 110 };
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
int index = (game.getActivePlayer() - 1) * 4 + i;
|
|
||||||
JButton jb = new JButton();
|
|
||||||
jb.setIcon(new ImageIcon("src/main/resources/" + pictures[index] + ".png"));
|
|
||||||
int selectedPiece = index;
|
|
||||||
jb.addActionListener(e -> {
|
|
||||||
System.out.println("Test");
|
|
||||||
result[0] = selectedPiece;
|
|
||||||
dialog.dispose();
|
|
||||||
});
|
|
||||||
dialog.add(jb);
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog.setLocationRelativeTo(null);
|
|
||||||
dialog.setVisible(true);
|
|
||||||
|
|
||||||
return result[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showWin(int player) {
|
public void showWin(int player) {
|
||||||
JFrame frame = new JFrame("Result");
|
JFrame frame = new JFrame("Result");
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue