Interface BehaviorController

All Superinterfaces:
Runnable
All Known Implementing Classes:
SimpleBehaviorController

public interface BehaviorController extends Runnable
Represents a collection of behaviors that are prioritised and executed.

The highest priority Behavior that returns true in Behavior.shouldExecute() is executed.

  • Method Details

    • addBehavior

      void addBehavior(Behavior behavior)
      Registers a Behavior.
      Parameters:
      behavior - The behavior
    • clear

      void clear()
      Clears the goal controller of all Behaviors. Will stop the execution of any current behavior.
    • isPaused

      boolean isPaused()
      Returns:
      Whether the controller is currently paused
      See Also:
    • removeBehavior

      void removeBehavior(Behavior behavior)
      Removes the given Behavior from rotation.
      Parameters:
      behavior - The behavior to remove
    • setPaused

      void setPaused(boolean paused)
      Sets whether the controller is paused. While paused, no new Behaviors will be selected and any executing goals will be suspended.
      Parameters:
      paused - Whether to pause execution