java.lang.Object
net.botwithus.rs3.game.scene.entities.Entity
net.botwithus.rs3.game.scene.entities.animation.Projectile
All Implemented Interfaces:
Identifiable, Validatable, Locatable

public final class Projectile extends Entity
  • Constructor Details

    • Projectile

      public Projectile(int id, Coordinate coordinate, int sourceIndex, int sourceType, int targetIndex, int targetType, long startCycle, long endCycle, Coordinate start, Coordinate end, ScenePosition scene)
  • Method Details

    • getSource

      public PathingEntity<?> getSource()
      Gets the source of this projectile animation.
      Returns:
      the source of this projectile animation or null if it cannot be determined.
    • getTarget

      public PathingEntity<?> getTarget()
      Gets the target of this projectile animation or null if it cannot be determined.
      Returns:
      The target of this projectile animation or null if it cannot be determined.
    • getStartCycle

      public long getStartCycle()
      Returns the start cycle of the Projectile.
      Returns:
      The start cycle of the Projectile.
    • getEndCycle

      public long getEndCycle()
      Returns the end cycle of the Projectile.
      Returns:
      The end cycle of the Projectile.
    • getStart

      public Coordinate getStart()
      Returns the start position of the projectile.
      Returns:
      The start position of the projectile.
    • getDestination

      public Coordinate getDestination()
      Returns the end position of the projectile.
      Returns:
      the end position of the projectile
    • getSpeed

      public double getSpeed()
      Calculates the speed of the animation.
      Returns:
      the speed of the animation
    • hasReachedTarget

      public boolean hasReachedTarget(long currentCycle)
      Checks if the current cycle has reached the target cycle.
      Parameters:
      currentCycle - The current cycle.
      Returns:
      True if the current cycle has reached the target cycle, false otherwise.
    • isInFlight

      public boolean isInFlight(long cycle)
      Checks if the projectile is in flight at the specified cycle.
      Parameters:
      cycle - The current cycle.
      Returns:
      True if the projectile is in flight, false otherwise.
    • validate

      public boolean validate()
      Description copied from interface: Validatable
      Gets whether the object is valid There can be many reasons a Validatable may not be valid. These can range from the entity has despawned, a component has closed, a coordinate is no longer in the scene, an animation sequence has ended, and many other reasons..
      Returns: