Class ShootTask
java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
com.deco2800.game.components.tasks.ShootTask
- All Implemented Interfaces:
PriorityTask
,Task
- Direct Known Subclasses:
ShootMultipleTask
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.deco2800.game.ai.tasks.Task
Task.Status
-
Field Summary
FieldsFields inherited from class com.deco2800.game.ai.tasks.DefaultTask
owner, status
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.deco2800.game.ai.tasks.DefaultTask
create, getStatus, stop
-
Field Details
-
target
-
TotalTime
-
-
Constructor Details
-
ShootTask
- Parameters:
target
- The entity to chase.priority
- Task priority when chasing (0 when not chasing).viewDistance
- Maximum distance from the entity at which chasing can start.
-
-
Method Details
-
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
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfacePriorityTask
-
getDistanceToTarget
protected float getDistanceToTarget() -
isTargetVisible
protected boolean isTargetVisible()
-