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 TypeMethodDescriptionvoid
create
(TaskRunner taskRunner) Create the Taskint
Get the priority of the taskvoid
start()
Start the taskvoid
Trigger the move to the predefined positionvoid
update()
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:
getPriority
in interfacePriorityTask
- Returns:
- The priority of the task
-
start
public void start()Start the task- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
create
Create the Task- Specified by:
create
in interfaceTask
- Overrides:
create
in classDefaultTask
- Parameters:
taskRunner
- Task runner to attach to
-
update
public void update()Update the task- Specified by:
update
in interfaceTask
- Overrides:
update
in classDefaultTask
-
triggerMoveToPredefinedPosition
public void triggerMoveToPredefinedPosition()Trigger the move to the predefined position
-