Class OpponentEnergy
java.lang.Object
privbot.mechanics.OpponentEnergy
Conservative upper bound for an opponent's special energy, based only on independently confirmed spends and
caller-supplied regeneration rules. The bound is not an observed energy reading and is valid only while those rules
cover every possible energy restoration; clear it if a refill, reset or unmodelled restoration may have happened.
Single-owner, reset per fight.
-
Constructor Summary
ConstructorsConstructorDescriptionOpponentEnergy(int regenAmount, int regenTicks) The caller supplies the verified server's regeneration amount and period; neither is assumed cross-server. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset on a new opponent, lock, death, disconnect or client session.voidconfirmedSpend(int tick, String eventId, Integer cost) Record an independently confirmed spend once per stable event ID.False only when the verified cost exceeds the bound; null for an invalid cost or uninitialised clock.voidobserve(int tick) Advance time without claiming any unseen special did or did not occur.Upper bound at the most recently observed tick, or null before the first observation.
-
Constructor Details
-
OpponentEnergy
public OpponentEnergy(int regenAmount, int regenTicks) The caller supplies the verified server's regeneration amount and period; neither is assumed cross-server.
-
-
Method Details
-
observe
public void observe(int tick) Advance time without claiming any unseen special did or did not occur. -
confirmedSpend
Record an independently confirmed spend once per stable event ID. An animation or accepted click alone is not proof of a cost. The caller must know the spend occurred on this exact tick; a delayed observation with an uncertain firing tick must not be recorded here. Unknown cost is not deducted. A possible same-tick regeneration is included in the upper bound. -
upperBound
Upper bound at the most recently observed tick, or null before the first observation. -
mayAfford
-
clear
public void clear()Reset on a new opponent, lock, death, disconnect or client session.
-