Make start-delay stop auto-start.

This commit is contained in:
garbagemule 2014-04-23 03:51:56 +02:00
parent 2e366f4bee
commit 9fb579b2ff

View File

@ -61,15 +61,24 @@ public class StartDelayTimer extends CountdownTimer implements TimerCallback {
@Override
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) {
super.start();
} else {
// Idempotent
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
public void onStart() {
internalCallback.onStart();