timer reset
This commit is contained in:
parent
89dc810d43
commit
7ec9b00a44
|
|
@ -180,7 +180,7 @@ public class MyInterface extends JFrame {
|
|||
game.setDefaultSetup();
|
||||
if (timerManager == null)
|
||||
timerManager = new TimerManager(whiteTimerLabel, blackTimerLabel, () -> gameOverByTimeout(), time);
|
||||
timerManager.reset();
|
||||
timerManager.reset(time);
|
||||
timerManager.start(true); // white starts
|
||||
}
|
||||
public void clickButtonAdder() {
|
||||
|
|
@ -236,7 +236,7 @@ public class MyInterface extends JFrame {
|
|||
game.setAutoPlayerDepth(depth);
|
||||
if (timerManager == null)
|
||||
timerManager = new TimerManager(whiteTimerLabel, blackTimerLabel, () -> gameOverByTimeout(), time);
|
||||
timerManager.reset();
|
||||
timerManager.reset(time);
|
||||
timerManager.start(game.getTurnColor());
|
||||
game.start();
|
||||
// this.repaint();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ public class TimerManager {
|
|||
timer.stop();
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
public void reset(int time) {
|
||||
whiteSeconds = time;
|
||||
blackSeconds = time;
|
||||
updateLabel(whiteLabel, whiteSeconds);
|
||||
updateLabel(blackLabel, blackSeconds);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue