Class ShotView

java.lang.Object
privbot.mechanics.ShotView

public final class ShotView extends Object
One projectile in flight, reduced to what attack tracking needs. Immutable.

What it proves: only that the caller read these values from a live projectile on one tick. The key (key()) identifies a single launch, because the same id, start cycle, end cycle and origin do not occur for two different shots.

Unreadable looks like: targetsUs() is null when the projectile's target could not be read. That is "unknown", never "not us".

Thread rule: pure value type, safe on any thread. Build it inside the same GameThread.ensure batch that read the projectile.

  • Constructor Details

    • ShotView

      public ShotView(int id, int startCycle, int endCycle, int remainingCycles, net.runelite.api.coords.WorldPoint origin, Boolean targetsUs)
  • Method Details

    • id

      public int id()
    • startCycle

      public int startCycle()
    • endCycle

      public int endCycle()
    • remainingCycles

      public int remainingCycles()
    • origin

      public net.runelite.api.coords.WorldPoint origin()
    • targetsUs

      public Boolean targetsUs()
      True or false when the target was read, null when it could not be.
    • key

      public String key()
      Identifies this launch: id:startCycle:endCycle:origin. Remaining cycles are not part of it.
    • toString

      public String toString()
      Overrides:
      toString in class Object