Class ProjectileTask

java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
com.deco2800.game.components.tasks.ProjectileTask
All Implemented Interfaces:
PriorityTask, Task

public class ProjectileTask extends DefaultTask implements PriorityTask
  • Constructor Details

    • ProjectileTask

      public ProjectileTask(Entity target, String projectileType, int priority, float viewDistance, float maxShootDistance, float speed, float waitTime)
      Parameters:
      target - The entity to chase.
      speed - The speed to chase at.
  • Method Details

    • start

      public void start()
      Start shoot.
      Specified by:
      start in interface Task
      Overrides:
      start in class DefaultTask
    • getPriority

      public int getPriority()
      Get the priority of this task
      Specified by:
      getPriority in interface PriorityTask
      Returns:
      the priority of this task
    • update

      public void update()
      Update projectile task.
      Specified by:
      update in interface Task
      Overrides:
      update in class DefaultTask
    • waiting

      public void waiting()
      If entity is waiting, set its task to shoot
    • shoot

      public void shoot(String projectileType)
      Shoot projectile
      Parameters:
      projectileType - the type of projectile to shoot
    • setTask

      public void setTask(Task task)
      Set the task
      Parameters:
      task - the task to set it to