update color
This commit is contained in:
@@ -57,7 +57,7 @@ public class Window extends JFrame implements OutputSystem {
|
||||
}
|
||||
|
||||
private Color getCellColor(int x, int y) {
|
||||
return ((x + y) % 2 == 1) ? Color.BLACK : Color.WHITE;
|
||||
return ((x + y) % 2 == 1) ? Color.DARK_GRAY : Color.LIGHT_GRAY;
|
||||
}
|
||||
|
||||
private void buildButtons(JPanel bottom) {
|
||||
@@ -207,13 +207,13 @@ public class Window extends JFrame implements OutputSystem {
|
||||
|
||||
@Override
|
||||
public void playerTurn(chess.model.Color color) {
|
||||
this.displayText.setText("C'est au tour de " + color);
|
||||
this.displayText.setText("Current turn: " + color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void winnerIs(chess.model.Color color) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Victoire de " + color);
|
||||
JOptionPane.showMessageDialog(this, "Victory of " + color);
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
@@ -221,28 +221,28 @@ public class Window extends JFrame implements OutputSystem {
|
||||
@Override
|
||||
public void kingIsInCheck() {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Échec !");
|
||||
JOptionPane.showMessageDialog(this, "Check!");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kingIsInMat() {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Échec et mat !");
|
||||
JOptionPane.showMessageDialog(this, "Checkmate!");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void patSituation() {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Pat. Égalité !");
|
||||
JOptionPane.showMessageDialog(this, "Pat. It's a draw!");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hasSurrendered(chess.model.Color color) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(this, "Abandon de " + color);
|
||||
JOptionPane.showMessageDialog(this, color + " has surrendered.");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user