Interface GoalExecutor<O extends Agent>

  • Type Parameters:
    O - The type of agent

    public interface GoalExecutor<O extends Agent>
    Represents a set of goals that will be updated together by an Agent.

    In Minecraft, most agents "live" by performing goals of their simulation (while sometimes using specialized "targeting" goals for logic).

    • Method Detail

      • owner

        O owner()
        The Agent that owns this goal.
        Returns:
        The owner
      • addGoal

        GoalExecutor<O> addGoal​(int priority,
                                Goal<? extends O> goal)
        Adds a new Goal to this goal.
        Parameters:
        priority - The priority this task should run at
        goal - The goal to run
        Returns:
        This goal, for chaining
      • removeGoal

        GoalExecutor<O> removeGoal​(Goal<? extends O> goal)
        Removes a specific Goal from this goal.
        Parameters:
        goal - The goal to remove
        Returns:
        This goal, for chaining
      • removeGoals

        GoalExecutor<O> removeGoals​(GoalType type)
        Removes all Goals whose GoalType matches the provided type.
        Parameters:
        type - The type to remove
        Returns:
        The goal, for chaining
      • tasksByType

        List<? super Goal<? extends O>> tasksByType​(GoalType type)
        Gets all Goals whose GoalType matches the provided type.
        Parameters:
        type - The type to look for
        Returns:
        All the tasks found
      • tasks

        List<? super Goal<? extends O>> tasks()
        Gets all Goals in this goal.
        Returns:
        The tasks
      • clear

        void clear()
        Clears all Goals from this goal.