Class HumanWanderTask

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

public class HumanWanderTask extends DefaultTask implements PriorityTask
HumanWanderTask is the entry point for the engineer entity's behaviour. Instantiates subtasks HumanWaitTask, HumanMovementTask and EngineerCombatTask, and manages transitions between the tasks. Engineer damage and death 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
    HumanWanderTask(float waitTime, float maxRange)
    Constructor of HumanWanderTask
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Fetches the priority of this task.
    void
    setSelected(boolean isSelected)
     
    void
    Starts the HumanWanderTask instance and instantiates subtasks (HumanWaitTask, HumanWanderTask, EngineerCombatTask).
    void
    Starts the combat task.
    void
    startMoving(com.badlogic.gdx.math.Vector2 destination)
    Starts the movement task, to a particular destination
    void
    Starts the wait task.
    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

    • HumanWanderTask

      public HumanWanderTask(float waitTime, float maxRange)
      Constructor of HumanWanderTask
      Parameters:
      waitTime - How long in seconds to wait between wandering.
      maxRange - Maximum detection and fighting range of the entity
  • 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 HumanWanderTask instance and instantiates subtasks (HumanWaitTask, HumanWanderTask, EngineerCombatTask).
      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
    • startWaiting

      public void startWaiting()
      Starts the wait task.
    • startMoving

      public void startMoving(com.badlogic.gdx.math.Vector2 destination)
      Starts the movement task, to a particular destination
      Parameters:
      destination - the Vector2 position to which the entity needs to move
    • startCombat

      public void startCombat()
      Starts the combat task.
    • setSelected

      public void setSelected(boolean isSelected)