Class Sequence

All Implemented Interfaces:
Goal, Behavior

public class Sequence extends Composite
Runs each Behavior in sequence.
  • Method Details Link icon

    • reset Link icon

      public void reset()
      Description copied from interface: Goal
      Resets the goal and any resources or state it is holding.
      Specified by:
      reset in interface Behavior
      Specified by:
      reset in interface Goal
      Overrides:
      reset in class Composite
    • retryChildren Link icon

      public boolean retryChildren()
    • run Link icon

      public BehaviorStatus run()
      Description copied from interface: Behavior
      Runs the behavior for one 'tick', optionally changing the state that it is in.
      Returns:
      The new state
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • createRetryingSequence Link icon

      public static Sequence createRetryingSequence(Behavior... behaviors)
    • createRetryingSequence Link icon

      public static Sequence createRetryingSequence(Collection<Behavior> behaviors)
      Creates a retrying sequence that will continue from the current Behavior if it returns BehaviorStatus.FAILURE instead of propagating the failure up to its parent.
    • createSequence Link icon

      public static Sequence createSequence(Behavior... behaviors)
    • createSequence Link icon

      public static Sequence createSequence(Collection<Behavior> behaviors)
      Creates sequence that will stop executing if the current Behavior returns BehaviorStatus.FAILURE.