Package com.csse3200.game.ai.tasks
Class DefaultTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
- All Implemented Interfaces:
Task
- Direct Known Subclasses:
AdjustedChaseTask,AimTask,BossTask,ChaseTask,MovementTask,ProjectileMovementTask,RunTask,ShootTask,SpecialAttackTask,WaitTask,WanderTask
A default task implementation that stores the associated entity and updates status when
starting/stopping a task. Removes some boilerplate code from each task.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(TaskRunner taskRunner) Create the task and attach it to the task runner.Get the current status of the task.voidstart()Start running this task.voidstop()Stop the task immediately.voidupdate()Run one frame of the task.
-
Field Details
-
owner
-
status
-
-
Constructor Details
-
DefaultTask
public DefaultTask()
-
-
Method Details
-
create
Description copied from interface:TaskCreate the task and attach it to the task runner. -
start
public void start()Description copied from interface:TaskStart running this task. This will usually be called by an AI controller. -
update
public void update()Description copied from interface:TaskRun one frame of the task. Similar to the update() in Components. -
stop
public void stop()Description copied from interface:TaskStop the task immediately. This can be called at any time by the AI controller. -
getStatus
Description copied from interface:TaskGet the current status of the task.
-