update color

This commit is contained in:
Janet-Doe
2025-04-10 11:00:37 +02:00
parent 4b84a30e07
commit 19b45371bb

View File

@@ -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) {
@@ -197,7 +197,7 @@ public class Window extends JFrame implements OutputSystem {
}
if (!this.lastClick.equals(new Coordinate(x, y))) {
Move move = new Move(lastClick, new Coordinate(x, y));
if (sendCommand(new MoveCommand(move)) == CommandResult.NotAllowed) {
drawInvalid(move);
}
@@ -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.");
});
}