mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 13:04:47 +00:00
Changed every instance of the word "predicate" to "condition"
This commit is contained in:
1 parent
9620c7064d
commit
c2cddf85e4
2 files changed
+49
-49
No files matched your search
@@ -8,32 +8,32 @@ import java.util.function.Supplier;
|
||||
public interface IConditionalAction extends IAction {
|
||||
|
||||
/**
|
||||
* @param predicate supplier checked every tick, if it returns true, task is fired
|
||||
* @param condition supplier checked every tick, if it returns true, task is fired
|
||||
* @return
|
||||
*/
|
||||
IConditionalAction setPredicate(Supplier<Boolean> predicate);
|
||||
IConditionalAction setCondition(Supplier<Boolean> condition);
|
||||
|
||||
/**
|
||||
* @param terminateWhen supplier checked every tick, if it returns true, action is terminated (gets marked done)
|
||||
* @return this action
|
||||
*/
|
||||
IConditionalAction setTerminationPredicate(Supplier<Boolean> terminateWhen);
|
||||
IConditionalAction terminateWhen(Supplier<Boolean> terminateWhen);
|
||||
|
||||
/**
|
||||
* @param onTermination code to run when the termination predicate returns true
|
||||
* @param onTermination code to run when the termination condition returns true
|
||||
* @return this action
|
||||
*/
|
||||
IConditionalAction setTerminationTask(Consumer<IAction> onTermination);
|
||||
IConditionalAction onTermination(Consumer<IAction> onTermination);
|
||||
|
||||
/**
|
||||
* @return true if predicate was satisfied and task ran (i.e can be called in termination task to see if original task was executed
|
||||
* @return true if condition was satisfied and task ran (i.e can be called in termination task to see if original task was executed
|
||||
* then do code based on that, if not return early)
|
||||
*/
|
||||
boolean wasTaskExecuted();
|
||||
|
||||
/**
|
||||
* Note: Only for Conditional Actions
|
||||
* @return how many times this conditional action has tested its predicate
|
||||
* @return how many times this conditional action has tested its condition
|
||||
*/
|
||||
int getCheckCount();
|
||||
|
||||
@@ -45,22 +45,22 @@ public interface IConditionalAction extends IAction {
|
||||
|
||||
|
||||
/**
|
||||
* @param maxChecks maximum times to test predicate before auto‐cancelling
|
||||
* @param maxChecks maximum times to test condition before auto‐cancelling
|
||||
* @return this action
|
||||
*/
|
||||
IConditionalAction setMaxChecks(int maxChecks);
|
||||
|
||||
IConditionalAction after(IConditionalAction after);
|
||||
|
||||
IConditionalAction after(Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
IConditionalAction after(Supplier<Boolean> condition, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction after(String name, Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
IConditionalAction after(String name, Supplier<Boolean> condition, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction after(Supplier<Boolean> predicate, Consumer<IAction> task, Supplier<Boolean> terminate);
|
||||
IConditionalAction after(Supplier<Boolean> condition, Consumer<IAction> task, Supplier<Boolean> terminate);
|
||||
|
||||
IConditionalAction after(String name, Supplier<Boolean> predicate, Consumer<IAction> task, Supplier<Boolean> terminate);
|
||||
IConditionalAction after(String name, Supplier<Boolean> condition, Consumer<IAction> task, Supplier<Boolean> terminate);
|
||||
|
||||
IConditionalAction after(Supplier<Boolean> predicate, Consumer<IAction> task, Supplier<Boolean> terminateWhen, Consumer<IAction> onTermination);
|
||||
IConditionalAction after(Supplier<Boolean> condition, Consumer<IAction> task, Supplier<Boolean> terminateWhen, Consumer<IAction> onTermination);
|
||||
|
||||
IConditionalAction after(String name, Supplier<Boolean> predicate, Consumer<IAction> task, Supplier<Boolean> terminateWhen, Consumer<IAction> onTermination);
|
||||
IConditionalAction after(String name, Supplier<Boolean> condition, Consumer<IAction> task, Supplier<Boolean> terminateWhen, Consumer<IAction> onTermination);
|
||||
}
|
||||
Reference in new issue
Block a user