Make start-delay stop auto-start.

This commit is contained in:
garbagemule
2014-04-23 03:51:56 +02:00
parent 2e366f4bee
commit 9fb579b2ff
@@ -61,15 +61,24 @@ public class StartDelayTimer extends CountdownTimer implements TimerCallback {
@Override @Override
public synchronized void start() { public synchronized void start() {
// Start auto-start-timer if arena has no start-delay // Start auto-start-timer if arena has no start-delay (both idempotent)
if (super.getDuration() > 0) { if (super.getDuration() > 0) {
super.start(); super.start();
} else { } else {
// Idempotent
autoStartTimer.start(); autoStartTimer.start();
} }
} }
@Override
public synchronized void stop() {
// Stop auto-start-timer if arena has no start-delay (both idempotent)
if (super.getDuration() > 0) {
super.stop();
} else {
autoStartTimer.stop();
}
}
@Override @Override
public void onStart() { public void onStart() {
internalCallback.onStart(); internalCallback.onStart();