O
- The type of agentpublic interface Goal<O extends Agent>
Agent
.
In Minecraft, most agents have just one goal which is living or
simulating, or whichever term you want to call it. Other agents, such as
Monster
s, use a "target" goal which serves to seek out potential
victims and execute a series of attack tasks.
Modifier and Type | Method and Description |
---|---|
Goal<O> |
addTask(int priority,
AITask<? extends O> task)
Adds a new
AITask to this goal. |
void |
clear()
Clears all
AITask s from this goal. |
O |
getOwner()
The
Agent that owns this goal. |
List<? super AITask<? extends O>> |
getTasks()
Gets all
AITask s in this goal. |
List<? super AITask<? extends O>> |
getTasksByType(AITaskType type)
Gets all
AITask s whose AITaskType matches
the provided type. |
GoalType |
getType()
The type of this goal.
|
Goal<O> |
removeTask(AITask<? extends O> task)
Removes a specific
AITask from this goal. |
Goal<O> |
removeTasks(AITaskType type)
Removes all
AITask s whose AITaskType matches
the provided type. |
GoalType getType()
Goal<O> addTask(int priority, AITask<? extends O> task)
AITask
to this goal.priority
- The priority this task should run attask
- The task to runGoal<O> removeTask(AITask<? extends O> task)
AITask
from this goal.task
- The task to removeGoal<O> removeTasks(AITaskType type)
AITask
s whose AITaskType
matches
the provided type.type
- The type to removeList<? super AITask<? extends O>> getTasksByType(AITaskType type)
AITask
s whose AITaskType
matches
the provided type.type
- The type to look forList<? super AITask<? extends O>> getTasks()
AITask
s in this goal.void clear()
AITask
s from this goal.