Class BombshipWanderTask

java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.bombship.BombshipWanderTask
All Implemented Interfaces:
PriorityTask, Task

public class BombshipWanderTask extends DefaultTask implements PriorityTask
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

    Constructors
    Constructor
    Description
    BombshipWanderTask(float waitTime, float maxRange)
    Constructor of BombshipWanderTask
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Fetches the priority of this task.
    void
    Starts the BombshipWanderTask instance and instantiates subtasks (BombshipWaitTask, BombshipWanderTask, BombshipCombatTask).
    void
    Operates the main logic of the entity in this task.

    Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask

    create, getStatus, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.csse3200.game.ai.tasks.Task

    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 interface PriorityTask
      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 interface Task
      Overrides:
      start in class DefaultTask
    • 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 interface Task
      Overrides:
      update in class DefaultTask