mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Added varargs chaining to IActions
i.e schedule(act1,act2,act3...)
This commit is contained in:
1 parent
b3c9c24f42
commit
393a7fbb56
2 files changed
+63
-1
No files matched your search
@@ -117,6 +117,18 @@ public class ActionManager implements IActionManager {
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schedule(IAction... actions) {
|
||||
for (IAction act : actions)
|
||||
schedule(act);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schedule(Consumer<IAction>... tasks) {
|
||||
for (Consumer<IAction> task : tasks)
|
||||
schedule(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction schedule(Consumer<IAction> task) {
|
||||
return schedule(create(task));
|
||||
@@ -257,7 +269,6 @@ public class ActionManager implements IActionManager {
|
||||
return schedule(new ConditionalAction(this, name, condition, task, terminateWhen, onTermination));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IConditionalAction schedule(IConditionalAction action) {
|
||||
conditionalActions.add(action);
|
||||
@@ -265,6 +276,12 @@ public class ActionManager implements IActionManager {
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schedule(IConditionalAction... actions) {
|
||||
for (IConditionalAction act : actions)
|
||||
schedule(act);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IConditionalAction> getConditionalActions() {
|
||||
return new ArrayList<>(conditionalActions);
|
||||
@@ -286,6 +303,18 @@ public class ActionManager implements IActionManager {
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleParallel(IAction... actions) {
|
||||
for (IAction act : actions)
|
||||
scheduleParallel(act);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleParallel(Consumer<IAction>... tasks) {
|
||||
for (Consumer<IAction> task : tasks)
|
||||
scheduleParallel(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleParallel(Consumer<IAction> task) {
|
||||
return scheduleParallel(create(task));
|
||||
|
||||
Reference in new issue
Block a user