Class ShotTracker
java.lang.Object
privbot.mechanics.ShotTracker
Tells a new projectile launch from one already seen. A projectile stays in the client's list for its whole flight,
so a plugin that reacts to every sighting reacts many times; this reports each launch once.
What it proves: a shot returned by fresh(java.util.Collection<privbot.mechanics.ShotView>) was not in the previous call's list (by
ShotView.key()). A key that leaves the list and later returns is a new shot.
Unreadable looks like: this holds no client state. Pass only shots that were actually read; a failed read should skip the call, because an empty list would make every live shot look new on the next call.
Thread rule: not thread safe; keep it on the one worker thread that samples shots. No client calls.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShotTracker
public ShotTracker()
-
-
Method Details
-
fresh
The shots inactivewhose key is new, in input order. Afterwards, keys not inactiveare forgotten. -
clear
public void clear()
-