Class TickingOneTimeEvent<S extends IState>
java.lang.Object
com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition<S>
com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition<S>
com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingEvent<S>
com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingOneTimeEvent<S>
- All Implemented Interfaces:
ITickingTransition<S>,IStateMachineEvent<S>,IStateMachineOneTimeEvent<S>,IStateMachineTransition<S>
- Direct Known Subclasses:
AIOneTimeEventTarget
public class TickingOneTimeEvent<S extends IState>
extends TickingEvent<S>
implements IStateMachineOneTimeEvent<S>
One time event that can be checked at the given tickrate, one time events are removed after causing a state transition. (Even when transitioning into the same state again)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTickingOneTimeEvent(@NotNull IStateEventType eventType, @NotNull IBooleanConditionSupplier condition, @NotNull IStateSupplier<S> nextState, int tickRate) Creates a new TickingEvent -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true when it should be removed after transitioning to a state.Methods inherited from class com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingEvent
getEventTypeMethods inherited from class com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition
countdownTicksToUpdate, getTickRate, setTickRate, setTicksToUpdateMethods inherited from class com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition
checkCondition, getMethodName, getName, getNextState, getState, withNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.entity.ai.statemachine.transitions.IStateMachineEvent
getEventTypeMethods inherited from interface com.minecolonies.api.entity.ai.statemachine.transitions.IStateMachineTransition
checkCondition, getName, getNextState, getState, withName
-
Constructor Details
-
TickingOneTimeEvent
protected TickingOneTimeEvent(@NotNull @NotNull IStateEventType eventType, @NotNull @NotNull IBooleanConditionSupplier condition, @NotNull @NotNull IStateSupplier<S> nextState, int tickRate) Creates a new TickingEvent- Parameters:
eventType- The type of the eventcondition- condition when the event appliesnextState- state the event transitions intotickRate- tickrate at which the event is checked
-
-
Method Details
-
shouldRemove
public boolean shouldRemove()Return true when it should be removed after transitioning to a state.- Specified by:
shouldRemovein interfaceIStateMachineOneTimeEvent<S extends IState>- Returns:
- true when ready to be removed
-