Class BasicTransition<S extends IState>

java.lang.Object
com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition<S>
All Implemented Interfaces:
IStateMachineTransition<S>
Direct Known Subclasses:
BasicEvent, TickingTransition

public class BasicTransition<S extends IState> extends Object implements IStateMachineTransition<S>
Basic Transition class for statemachines. Consists of a state the transition applies in, a statesupplier which determines its next state and a condition which has to be true to transition into the next state.
  • Constructor Details

    • BasicTransition

      public BasicTransition(@NotNull S state, @NotNull @NotNull IBooleanConditionSupplier condition, @NotNull @NotNull IStateSupplier<S> nextState)
      Creating a new transition from State A to B under condition C
      Parameters:
      state - State A
      condition - Condition C
      nextState - State B
    • BasicTransition

      protected BasicTransition(@NotNull @NotNull IBooleanConditionSupplier condition, @NotNull @NotNull IStateSupplier<S> nextState)
      Protected Constructor to allow subclasses without a state
      Parameters:
      condition - the condition.
      nextState - the next state to go to.
  • Method Details