Class WorkerIdleTask
java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
com.deco2800.game.worker.components.movement.WorkerIdleTask
- All Implemented Interfaces:
PriorityTask,Task
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.deco2800.game.ai.tasks.Task
Task.Status -
Field Summary
Fields inherited from class com.deco2800.game.ai.tasks.DefaultTask
owner, status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the current movement taskintbooleanisIdling()Return whether the worker is currently idling.voidstart()Start running this task.voidstartMoving(com.badlogic.gdx.math.Vector2 target) Moves the worker to the targetvoidupdate()Run one frame of the task.Methods inherited from class com.deco2800.game.ai.tasks.DefaultTask
create, getStatus, stop
-
Constructor Details
-
WorkerIdleTask
public WorkerIdleTask()
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfacePriorityTask
-
start
public void start()Description copied from interface:TaskStart running this task. This will usually be called by an AI controller.- Specified by:
startin interfaceTask- Overrides:
startin classDefaultTask
-
update
public void update()Description copied from interface:TaskRun one frame of the task. Similar to the update() in Components.- Specified by:
updatein interfaceTask- Overrides:
updatein classDefaultTask
-
startMoving
public void startMoving(com.badlogic.gdx.math.Vector2 target) Moves the worker to the target- Parameters:
target- target of the worker
-
getMovementTask
Return the current movement task- Returns:
- the movement task
-
isIdling
public boolean isIdling()Return whether the worker is currently idling.- Returns:
- True if the worker is stationary. False otherwise.
-