Class OverheadWatch
Lifted from ElorinPvP model/OverheadMemo, with HeadIcon replaced by the overhead's NAME (the
HeadIcon constant name, as ctx.pvp reports it), so no client enum constant is referenced. A one-tick
flick is evidence, not a command: a style counts as blocked only once the same overhead has been read for
debounceTicks readable ticks in a row (default 2, ElorinPvP's
COMMIT_BREAK_DEBOUNCE_TICKS, ElorinPvPConstants.java:146).
Null is UNKNOWN. An unreadable overhead (null) neither restarts the run nor counts as a tick of it, so
MELEE, null, MELEE is two ticks of MELEE. A readable change, including "NONE", starts a candidate run;
the last established block remains in force until that candidate itself reaches the debounce window.
Names to styles: MELEE/DEFLECT_MELEE block melee, RANGED/DEFLECT_RANGE ranged,
MAGIC/DEFLECT_MAGE magic; the combined icons RANGE_MAGE, RANGE_MELEE,
MAGE_MELEE block both their styles and RANGE_MAGE_MELEE all three. Matching is case-blind.
Thread rule: mutable, single-owner. Feed it once per tick from the thread that reads the opponent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intReadable ticks in a row before an overhead blocks a style.static final int"Never happened". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblocked(int tick) The one style their overhead has blocked for at least the debounce window.intblockedFor(CombatStyle style) How many readable ticks in a row their overhead has blockedstyle, regardless of the debounce; 0 when the current overhead does not block it or nothing readable has been seen.blockedSet(int tick) Every style their overhead has blocked for at least the debounce window; empty when none, when nothing readable has been seen, or whentickis before the newest reading.intThe first tick of the current run when its overhead blocks any style (debounced or not), elseNEVER.static Set<CombatStyle> The styles an overhead name blocks; empty for null,"NONE"or a non-protection prayer.One tick's reading of their overhead name.toString()
-
Field Details
-
DEFAULT_DEBOUNCE_TICKS
public static final int DEFAULT_DEBOUNCE_TICKSReadable ticks in a row before an overhead blocks a style.- See Also:
-
NEVER
public static final int NEVER"Never happened".- See Also:
-
-
Constructor Details
-
OverheadWatch
public OverheadWatch() -
OverheadWatch
public OverheadWatch(int debounceTicks) - Parameters:
debounceTicks- readable ticks in a row before a style counts as blocked; at least 1
-
-
Method Details
-
observe
One tick's reading of their overhead name. Null is unreadable: nothing changes. The same overhead again is one more tick of the run (the same tick twice counts once); a different one starts a new run at this tick.- Returns:
- this watch, for chaining
-
blocked
The one style their overhead has blocked for at least the debounce window. Null when none is blocked, when nothing readable has been seen, whentickis before the newest reading, or when the overhead blocks more than one style (a combined icon: readblockedSet(int)). -
blockedSet
Every style their overhead has blocked for at least the debounce window; empty when none, when nothing readable has been seen, or whentickis before the newest reading. -
blockedFor
How many readable ticks in a row their overhead has blockedstyle, regardless of the debounce; 0 when the current overhead does not block it or nothing readable has been seen. -
blockedSince
public int blockedSince()The first tick of the current run when its overhead blocks any style (debounced or not), elseNEVER. -
blocks
The styles an overhead name blocks; empty for null,"NONE"or a non-protection prayer. -
toString
-