mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 08:24:47 +00:00
Added varargs chaining to IActions
i.e schedule(act1,act2,act3...)
This commit is contained in:
1 parent
f0f1c9c917
commit
a588062c98
2 files changed
+56
No files matched your search
@@ -113,6 +113,14 @@ public interface IActionManager {
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* Multiple actions chained one after another
|
||||
* i.e schedule(act1,act2,act3,...)
|
||||
*
|
||||
* @param actions
|
||||
*/
|
||||
void schedule(IAction... actions);
|
||||
|
||||
/**
|
||||
* Schedule an existing action for execution.
|
||||
*
|
||||
@@ -121,6 +129,14 @@ public interface IActionManager {
|
||||
*/
|
||||
IAction schedule(IAction action);
|
||||
|
||||
/**
|
||||
* Multiple tasks chained one after another
|
||||
* i.e schedule(task1,task2,task3,...)
|
||||
*
|
||||
* @param tasks
|
||||
*/
|
||||
void schedule(Consumer<IAction>... tasks);
|
||||
|
||||
/**
|
||||
* Convenience for {@link #create(Consumer)} + enqueue.
|
||||
*
|
||||
@@ -274,6 +290,14 @@ public interface IActionManager {
|
||||
*/
|
||||
IConditionalAction schedule(String name, Function<IAction, Boolean> condition, Consumer<IAction> task, Function<IAction, Boolean> terminateWhen, Consumer<IAction> onTermination);
|
||||
|
||||
/**
|
||||
* Multiple conditionals
|
||||
* i.e schedule(act1,act2,act3,...)
|
||||
*
|
||||
* @param actions
|
||||
*/
|
||||
void schedule(IConditionalAction... actions);
|
||||
|
||||
IConditionalAction schedule(IConditionalAction action);
|
||||
|
||||
/**
|
||||
@@ -313,6 +337,14 @@ public interface IActionManager {
|
||||
*/
|
||||
boolean hasConditional(String name);
|
||||
|
||||
/**
|
||||
* Multiple actions in parallel
|
||||
* i.e scheduleParallel(act1,act2,act3,...)
|
||||
*
|
||||
* @param actions
|
||||
*/
|
||||
void scheduleParallel(IAction... actions);
|
||||
|
||||
/**
|
||||
* Schedules actions on the parallelQueue, where all actions are executed simultaneously
|
||||
*
|
||||
@@ -322,6 +354,8 @@ public interface IActionManager {
|
||||
|
||||
IAction scheduleParallel(IAction action);
|
||||
|
||||
void scheduleParallel(Consumer<IAction>... tasks);
|
||||
|
||||
IAction scheduleParallel(Consumer<IAction> task);
|
||||
|
||||
IAction scheduleParallel(int delay, Consumer<IAction> task);
|
||||
|
||||
@@ -197,6 +197,22 @@ public interface IAction {
|
||||
*/
|
||||
IAction after(IAction after);
|
||||
|
||||
/**
|
||||
* Multiple actions chained one after another
|
||||
* i.e after(act1,act2,act3,...)
|
||||
*
|
||||
* @param actions
|
||||
*/
|
||||
void after(IAction... actions);
|
||||
|
||||
/**
|
||||
* Multiple tasks chained one after another
|
||||
* i.e after(task1,task2,task3,...)
|
||||
*
|
||||
* @param tasks
|
||||
*/
|
||||
void after(Consumer<IAction>... tasks);
|
||||
|
||||
IAction after(String name, int maxDuration, int delay, Consumer<IAction> t);
|
||||
|
||||
IAction after(String name, int delay, Consumer<IAction> t);
|
||||
@@ -231,6 +247,8 @@ public interface IAction {
|
||||
*/
|
||||
IConditionalAction conditional(IConditionalAction after);
|
||||
|
||||
void conditional(IConditionalAction... actions);
|
||||
|
||||
IConditionalAction conditional(Function<IAction,Boolean> condition, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction conditional(String name, Function<IAction,Boolean> condition, Consumer<IAction> task);
|
||||
@@ -250,8 +268,12 @@ public interface IAction {
|
||||
*/
|
||||
IAction parallel(IAction after);
|
||||
|
||||
void parallel(IAction... actions);
|
||||
|
||||
IAction parallel(Consumer<IAction> task);
|
||||
|
||||
void parallel(Consumer<IAction>... tasks);
|
||||
|
||||
IAction parallel(int delay, Consumer<IAction> task);
|
||||
|
||||
IAction parallel(String name, Consumer<IAction> task);
|
||||
|
||||
Reference in new issue
Block a user