Class HumanWanderTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.human.HumanWanderTask
- All Implemented Interfaces:
PriorityTask
,Task
HumanWanderTask is the entry point for the engineer entity's behaviour. Instantiates subtasks HumanWaitTask,
HumanMovementTask and EngineerCombatTask, and manages transitions between the tasks. Engineer damage and death
handled in this class.
-
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
ConstructorDescriptionHumanWanderTask
(float waitTime, float maxRange) Constructor of HumanWanderTask -
Method Summary
Modifier and TypeMethodDescriptionint
Fetches the priority of this task.void
setSelected
(boolean isSelected) void
start()
Starts the HumanWanderTask instance and instantiates subtasks (HumanWaitTask, HumanWanderTask, EngineerCombatTask).void
Starts the combat task.void
startMoving
(com.badlogic.gdx.math.Vector2 destination) Starts the movement task, to a particular destinationvoid
Starts the wait task.void
update()
Operates the main logic of the entity in this task.Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus, stop
-
Constructor Details
-
HumanWanderTask
public HumanWanderTask(float waitTime, float maxRange) Constructor of HumanWanderTask- Parameters:
waitTime
- How long in seconds to wait between wandering.maxRange
- Maximum detection and fighting range of the entity
-
-
Method Details
-
getPriority
public int getPriority()Fetches the priority of this task.- Specified by:
getPriority
in interfacePriorityTask
- Returns:
- current priority of this task. Priority for this task is a set value and does not change.
-
start
public void start()Starts the HumanWanderTask instance and instantiates subtasks (HumanWaitTask, HumanWanderTask, EngineerCombatTask).- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
update
public void update()Operates the main logic of the entity in this task. All calls to switch to particular states are determined during the update phase. The logical flow is: - Check if the entity has died since last update - Check if the entity has finished dying - If not dead- Specified by:
update
in interfaceTask
- Overrides:
update
in classDefaultTask
-
startWaiting
public void startWaiting()Starts the wait task. -
startMoving
public void startMoving(com.badlogic.gdx.math.Vector2 destination) Starts the movement task, to a particular destination- Parameters:
destination
- the Vector2 position to which the entity needs to move
-
startCombat
public void startCombat()Starts the combat task. -
setSelected
public void setSelected(boolean isSelected)
-