Class DefaultTask

java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
BombshipCombatTask, BombshipMovementTask, BombshipWaitTask, BombshipWanderTask, ChaseTask, CurrencyTask, DemonBossTask, DroidCombatTask, EngineerCombatTask, FinalBossMovementTask, FireTowerCombatTask, FireworksTowerCombatTask, HumanMovementTask, HumanWaitTask, HumanWanderTask, IceBabyTask, MobAttackTask, MobBossDeathTask, MobDeathTask, MobMeleeAttackTask, MobRangedAttackTask, MobShootTask, MobWanderTask, MovementTask, MoveToMiddleTask, PatrickDeathTask, PatrickTask, PatrickTeleportTask, PierceTowerCombatTask, RangeBossTask, RicochetTowerCombatTask, ScannerTask, ShootTask, SlimeyBoyTask, SpawnWaveTask, StunTowerCombatTask, TNTTowerCombatTask, TowerCombatTask, TrajectTask, WaitTask, WallTowerDestructionTask, WaveTask

public abstract class DefaultTask extends 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.
  • Field Details

  • Constructor Details

    • DefaultTask

      public DefaultTask()
  • Method Details

    • create

      public void create(TaskRunner taskRunner)
      Description copied from interface: Task
      Create the task and attach it to the task runner.
      Specified by:
      create in interface Task
      Parameters:
      taskRunner - Task runner to attach to
    • 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 interface Task
    • 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 interface Task
    • stop

      public void stop()
      Description copied from interface: Task
      Stop the task immediately. This can be called at any time by the AI controller.
      Specified by:
      stop in interface Task
    • getStatus

      public Task.Status getStatus()
      Description copied from interface: Task
      Get the current status of the task.
      Specified by:
      getStatus in interface Task
      Returns:
      status