Class BombshipWanderTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.bombship.BombshipWanderTask
- All Implemented Interfaces:
PriorityTask
,Task
BombshipWanderTask is the entry point for the engineer entity's behaviour. Instantiates subtasks HumanWaitTask,
BombshipMovementTask and BombshipCombatTask, and manages transitions between the tasks. Bombship damage and destruction is
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
ConstructorDescriptionBombshipWanderTask
(float waitTime, float maxRange) Constructor of BombshipWanderTask -
Method Summary
Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus, stop
-
Constructor Details
-
BombshipWanderTask
public BombshipWanderTask(float waitTime, float maxRange) Constructor of BombshipWanderTask- Parameters:
waitTime
- How long in seconds to wait between wandering.maxRange
- Maximum of the entity to fight
-
-
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 BombshipWanderTask instance and instantiates subtasks (BombshipWaitTask, BombshipWanderTask, BombshipCombatTask).- 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
-