diff --git a/OOP_2B1_Project/src/windowInterface/MyInterface.java b/OOP_2B1_Project/src/windowInterface/MyInterface.java index 527b33c..302dc8c 100644 --- a/OOP_2B1_Project/src/windowInterface/MyInterface.java +++ b/OOP_2B1_Project/src/windowInterface/MyInterface.java @@ -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."); } }