Conditional Task
constructor(@NonNull trueTask: Task, @NonNull falseTask: Task, @NonNull conditionOnInit: BooleanSupplier)
Create a new conditional task with the given tasks and condition. Supplied tasks will be reset on init.
Parameters
true Task
the task to run if the condition is true
false Task
the task to run if the condition is false
condition On Init
the condition to evaluate on initialisation
constructor(@NonNull onTrue: Runnable, @NonNull onFalse: Runnable, @NonNull conditionOnInit: BooleanSupplier)
Create a new conditional task with the given callbacks and condition. Supplied tasks will be reset on init.
Parameters
on True
the callback to run if the condition is true
on False
the callback to run if the condition is false
condition On Init
the condition to evaluate on initialisation