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 taskint
boolean
isIdling()
Return whether the worker is currently idling.void
start()
Start running this task.void
startMoving
(com.badlogic.gdx.math.Vector2 target) Moves the worker to the targetvoid
update()
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:
getPriority
in interfacePriorityTask
-
start
public void start()Description copied from interface:Task
Start running this task. This will usually be called by an AI controller.- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
update
public void update()Description copied from interface:Task
Run one frame of the task. Similar to the update() in Components.- Specified by:
update
in interfaceTask
- Overrides:
update
in 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.
-