Class TickingOneTimeEvent<S extends IState>

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 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 event
      condition - condition when the event applies
      nextState - state the event transitions into
      tickRate - 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:
      shouldRemove in interface IStateMachineOneTimeEvent<S extends IState>
      Returns:
      true when ready to be removed