Class CueTimeline

java.lang.Object
privbot.mechanics.CueTimeline

public final class CueTimeline extends Object
Holds the combat style the most recently LAUNCHED attack demands. Projectiles arrive in the order they land, not the order they were fired, so a slow old flight must not overwrite a newer attack; offers are compared by launch cycle.

What it proves: current() is the style of the latest launch offered so far.

Unreadable looks like: current() is null and lastCycle() is -1 while nothing is held. Callers act only on a non-null style.

Thread rule: not thread safe; keep it on the one worker thread that samples cues. No client calls.

  • Constructor Details

    • CueTimeline

      public CueTimeline()
  • Method Details

    • offer

      public boolean offer(CombatStyle style, int launchCycle)
      Accepts the cue when nothing is held or launchCycle is later than the held one. Returns whether it did.
    • current

      public CombatStyle current()
    • lastCycle

      public int lastCycle()
      The held cue's launch cycle, or -1 when empty.
    • clear

      public void clear()