Handle interval == 0 windups

This commit is contained in:
Daniel Saukel 2020-03-19 17:06:23 +01:00
parent 53cd13b0ec
commit 0a3d559b39
2 changed files with 9 additions and 13 deletions

View File

@ -153,9 +153,13 @@ public abstract class Windup extends Deactivatable {
@Override @Override
public void activate() { public void activate() {
if (interval <= 0) {
runnable.run();
} else {
active = true; active = true;
startTask(); startTask();
} }
}
/** /**
* Cancels the {@link #getTask() task}. * Cancels the {@link #getTask() task}.
@ -163,8 +167,10 @@ public abstract class Windup extends Deactivatable {
@Override @Override
public void deactivate() { public void deactivate() {
active = false; active = false;
if (getTask() != null) {
getTask().cancel(); getTask().cancel();
} }
}
/** /**
* Activates the sign if it is not yet active and deactivates it if it is already active. * Activates the sign if it is not yet active and deactivates it if it is already active.

View File

@ -102,14 +102,4 @@ public class DropSign extends Windup {
}); });
} }
@Override
public void activate() {
if (interval < 0) {
active = true;
getRunnable().run();
} else {
super.activate();
}
}
} }