Interface ITickRateStateMachine<S extends IState>
- All Superinterfaces:
IStateMachine<ITickingTransition<S>,S>
- All Known Implementing Classes:
TickRateStateMachine
public interface ITickRateStateMachine<S extends IState>
extends IStateMachine<ITickingTransition<S>,S>
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckTransition(@NotNull ITickingTransition<S> transition) Check the condition for a transitionintReturns the current rate the statemachine is beeing ticked at.voidsetCurrentDelay(int ticksToNext) Sets the delay to next execution for the currently executed transitionvoidsetTickRate(int tickRate) Returns the current rate the statemachine is beeing ticked at.voidtick()Tick the statemachine.Methods inherited from interface com.minecolonies.api.entity.ai.statemachine.basestatemachine.IStateMachine
addTransition, addTransitionGroup, getHistory, getState, removeTransition, reset, setHistoryEnabled, transitionToNext
-
Method Details
-
tick
void tick()Tick the statemachine.- Specified by:
tickin interfaceIStateMachine<ITickingTransition<S extends IState>,S extends IState>
-
checkTransition
Check the condition for a transition- Specified by:
checkTransitionin interfaceIStateMachine<ITickingTransition<S extends IState>,S extends IState> - Parameters:
transition- the target to check- Returns:
- true if this target worked and we should stop executing this tick
-
getTickRate
int getTickRate()Returns the current rate the statemachine is beeing ticked at.- Returns:
- the tickrate
-
setTickRate
void setTickRate(int tickRate) Returns the current rate the statemachine is beeing ticked at.- Parameters:
tickRate- the tick rate to set.
-
setCurrentDelay
void setCurrentDelay(int ticksToNext) Sets the delay to next execution for the currently executed transition- Parameters:
ticksToNext-
-