Class JumpTask

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

public class JumpTask extends DefaultTask implements PriorityTask
Jump to an entity and attack it if it is still in attacking range.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.deco2800.game.ai.tasks.Task

    Task.Status
  • Field Summary

    Fields inherited from class com.deco2800.game.ai.tasks.DefaultTask

    owner, status
  • Constructor Summary

    Constructors
    Constructor
    Description
    JumpTask(Entity target, int priority, float attackRange, float glidingSpeed, float knockBackForce)
    Create a JumpTask with target, attack range, gliding speed and knock back distance.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the priority of this task.
    void
    Start the jump task.
    void
    Stop the jump task.
    void
    Update the jump task.

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

    create, getStatus

    Methods inherited from class java.lang.Object

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

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

    create, getStatus
  • Constructor Details

    • JumpTask

      public JumpTask(Entity target, int priority, float attackRange, float glidingSpeed, float knockBackForce)
      Create a JumpTask with target, attack range, gliding speed and knock back distance.
      Parameters:
      target - The target entity will be jumped at.
      priority - Task priority when jumping.
      attackRange - Maximum distance from the entity while gliding before giving up.
      glidingSpeed - The speed to glide at.
      knockBackForce - The magnitude of the knock back applied to the entity.
  • Method Details

    • start

      public void start()
      Start the jump task.
      Specified by:
      start in interface Task
      Overrides:
      start in class DefaultTask
    • update

      public void update()
      Update the jump task.
      Specified by:
      update in interface Task
      Overrides:
      update in class DefaultTask
    • stop

      public void stop()
      Stop the jump task.
      Specified by:
      stop in interface Task
      Overrides:
      stop in class DefaultTask
    • getPriority

      public int getPriority()
      Get the priority of this task.
      Specified by:
      getPriority in interface PriorityTask
      Returns:
      integer representing the priority of this task.