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
ConstructorsConstructorDescriptionHumanWanderTask(float waitTime, float maxRange) Constructor of HumanWanderTask -
Method Summary
Modifier and TypeMethodDescriptionintFetches the priority of this task.voidsetSelected(boolean isSelected) voidstart()Starts the HumanWanderTask instance and instantiates subtasks (HumanWaitTask, HumanWanderTask, EngineerCombatTask).voidStarts the combat task.voidstartMoving(com.badlogic.gdx.math.Vector2 destination) Starts the movement task, to a particular destinationvoidStarts the wait task.voidupdate()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:
getPriorityin 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:
startin interfaceTask- Overrides:
startin 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:
updatein interfaceTask- Overrides:
updatein 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)
-