ActionQueue.stopWhenEmpty

This commit is contained in:
bigguy345 committed 2025-07-08 14:22:49 +03:00
1 parent b37f9a7ea4
commit 70f0ab1e6f
1 file changed
+17
@@ -19,6 +19,8 @@ public class ActionQueue implements IActionQueue {
protected boolean isParallel;
protected boolean isDead;
protected boolean stopWhenEmpty;
protected boolean killWhenEmpty;
protected int killWhenEmptyAfter = 100;
@@ -70,6 +72,18 @@ public class ActionQueue implements IActionQueue {
isParallel = parallel;
return this;
}
@Override
public boolean isStoppedWhenEmpty() {
return stopWhenEmpty;
}
@Override
public IActionQueue stopWhenEmpty(boolean stopWhenEmpty) {
this.stopWhenEmpty = stopWhenEmpty;
return this;
}
@Override
public boolean isKilledWhenEmpty() {
return killWhenEmpty;
@@ -309,6 +323,9 @@ public class ActionQueue implements IActionQueue {
pit.remove();
}
if (stopWhenEmpty && !hasActiveTasks())
stop();
killWhenEmpty();
if (manager.debug && active)