Package com.deco2800.game.ai.tasks
Class DefaultTask
java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
- All Implemented Interfaces:
 Task
- Direct Known Subclasses:
 ChaseTask,MovementTask,ObstacleAttackTask,WaitTask,WanderTask
public abstract class DefaultTask extends java.lang.Object implements Task
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
 - 
Field Summary
Fields Modifier and Type Field Description protected TaskRunnerownerprotected Task.Statusstatus - 
Constructor Summary
Constructors Constructor Description DefaultTask() - 
Method Summary
Modifier and Type Method Description voidcreate(TaskRunner taskRunner)Create the task and attach it to the task runner.Task.StatusgetStatus()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
 - 
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. 
 -