check draw
This commit is contained in:
@@ -200,9 +200,7 @@ public class Window extends JFrame implements GameListener {
|
||||
|
||||
@Override
|
||||
public void onWin(chess.model.Color color) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Victory of " + color);
|
||||
});
|
||||
JOptionPane.showMessageDialog(this, "Victory of " + color);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -223,16 +221,12 @@ public class Window extends JFrame implements GameListener {
|
||||
|
||||
@Override
|
||||
public void onPatSituation() {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Pat. It's a draw!");
|
||||
});
|
||||
JOptionPane.showMessageDialog(this, "Pat. It's a draw!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurrender(chess.model.Color color) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, color + " has surrendered.");
|
||||
});
|
||||
JOptionPane.showMessageDialog(this, color + " has surrendered.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -299,4 +293,9 @@ public class Window extends JFrame implements GameListener {
|
||||
drawInvalid(move);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw() {
|
||||
JOptionPane.showMessageDialog(this, "Same position was repeated three times. It's a draw!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user