Class PathFollowTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.PathFollowTask
- All Implemented Interfaces:
PriorityTask,Task
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status -
Field Summary
Fields inherited from class com.csse3200.game.ai.tasks.DefaultTask
owner, status -
Constructor Summary
ConstructorsConstructorDescriptionPathFollowTask(com.badlogic.gdx.math.Vector2 targetPos, float waitingTime) Task to make an entity follow a path to a target position. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(TaskRunner taskRunner) Create the TaskintGet the priority of the taskvoidstart()Start the taskvoidTrigger the move to the predefined positionvoidupdate()Update the taskMethods inherited from class com.csse3200.game.ai.tasks.DefaultTask
getStatus, stop
-
Constructor Details
-
PathFollowTask
public PathFollowTask(com.badlogic.gdx.math.Vector2 targetPos, float waitingTime) Task to make an entity follow a path to a target position.- Parameters:
targetPos- The target position to move towaitingTime- The making time from the recipe, scaled by any time factor like DEFAULT_TIMER if needed.
-
-
Method Details
-
getPriority
public int getPriority()Get the priority of the task- Specified by:
getPriorityin interfacePriorityTask- Returns:
- The priority of the task
-
start
public void start()Start the task- Specified by:
startin interfaceTask- Overrides:
startin classDefaultTask
-
create
Create the Task- Specified by:
createin interfaceTask- Overrides:
createin classDefaultTask- Parameters:
taskRunner- Task runner to attach to
-
update
public void update()Update the task- Specified by:
updatein interfaceTask- Overrides:
updatein classDefaultTask
-
triggerMoveToPredefinedPosition
public void triggerMoveToPredefinedPosition()Trigger the move to the predefined position
-