Class FutureBattleTask<E extends BattleEvent,A>
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.FutureBattleTask<E,A>
- Type Parameters:
E
- The type of event to listen forA
- The type returned from the function
This class is used for storing the future tasks added to the battle
When the event relating to the stored event class (E) is fired it will call
the function and then
CompletableFuture.complete(Object)
with the returned object in that order
Then it will remove the future battle task from the stored list of tasks-
Field Summary
Modifier and TypeFieldDescriptionprotected final BiFunction<E,
BattleController, A> protected final CompletableFuture<A>
protected final boolean
-
Constructor Summary
ConstructorDescriptionFutureBattleTask
(Class<E> eventClass, BiFunction<E, BattleController, A> consumer, CompletableFuture<A> future, boolean persistent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
-
Field Details
-
eventClass
-
consumer
-
future
-
persistent
protected final boolean persistent
-
-
Constructor Details
-
FutureBattleTask
public FutureBattleTask(Class<E> eventClass, BiFunction<E, BattleController, A> consumer, CompletableFuture<A> future, boolean persistent)
-
-
Method Details
-
getEventClass
-
isPersistent
public boolean isPersistent() -
complete
-