Interface Goals


public interface Goals
The prioritized list of goals driving a mob.
Since:
0.1.0
  • Method Details

    • add

      void add(Goal goal)
      Adds a goal and re-sorts the container by priority.
      Parameters:
      goal - the goal to add
      Since:
      0.1.0
    • remove

      boolean remove(Goal goal)
      Parameters:
      goal - the goal to drop
      Returns:
      true if the goal was present
      Since:
      0.1.0
    • removeIf

      boolean removeIf(Predicate<Goal> filter)
      Parameters:
      filter - selects the goals to drop
      Returns:
      true if at least one goal was dropped
      Since:
      0.1.0
    • removeType

      default boolean removeType(Class<? extends Goal> type)
      Parameters:
      type - the goal implementation to drop
      Returns:
      true if at least one goal was dropped
      Since:
      0.1.0
    • clear

      void clear()
      Drops every goal, stopping the active one first.
      Since:
      0.1.0
    • all

      List<Goal> all()
      Returns:
      an immutable snapshot of the goals, sorted by priority
      Since:
      0.1.0
    • active

      @Nullable Goal active()
      Returns:
      the goal currently running, or null when the mob is idle
      Since:
      0.1.0
    • stopAll

      void stopAll()
      Stops the active goal without removing anything.
      Since:
      0.1.0