This commit is contained in:
Romain MURPHY 2025-05-07 20:57:52 +02:00
parent 0b6afd2ef2
commit 08c842e90e
1 changed files with 6 additions and 1 deletions

View File

@ -229,7 +229,12 @@ public class MyInterface extends JFrame {
panelDraw.setGame(game);
int depth = askDifficulty();
int time = askTime();
game.setAutoPlayerDepth(depth);
if (timerManager == null)
timerManager = new TimerManager(whiteTimerLabel, blackTimerLabel, () -> gameOverByTimeout(), time);
timerManager.reset();
timerManager.start(game.getTurnColor());
game.start();
// this.repaint();
// update(game.getTurnNumber(), game.getTurnColor());
@ -339,6 +344,6 @@ public class MyInterface extends JFrame {
public void gameOverByTimeout() {
// disable board input, show message
JOptionPane.showMessageDialog(this, "Time's up! The game is over.");
// JOptionPane.showMessageDialog(this, "Time's up! The game is over.");
}
}