パッケージ simulation.event
インタフェース TimerEvent
- 既知の実装クラスのリスト:
PeriodicDamageEvent,SimpleTimerEvent
public interface TimerEvent
Contract for all time-driven events managed by the
CombatSimulator event queue.
Events are stored in a priority queue ordered by getNextTickTime() and are
fired by CombatSimulator.advanceTime(double) as simulation time reaches each event's
scheduled tick. After ticking, an event is re-queued unless isFinished(double) returns
true.
Typical use-cases include periodic DoT (e.g. Electro-Charged ticks), buff expiry notifications, and cooldown timers.
-
メソッドの概要
修飾子とタイプメソッド説明doubleReturns the simulation time at which this event's nexttick(simulation.CombatSimulator)should fire.booleanisFinished(double currentTime) Returns whether this event has completed and should be removed from the queue.voidtick(CombatSimulator sim) Executes the event's logic at the current simulation time.
-
メソッドの詳細
-
getNextTickTime
double getNextTickTime()Returns the simulation time at which this event's nexttick(simulation.CombatSimulator)should fire.- 戻り値:
- next tick time in seconds
-
tick
Executes the event's logic at the current simulation time. Implementations may callCombatSimulator.performActionWithoutTimeAdvance(java.lang.String, simulation.action.AttackAction),CombatSimulator.recordDamage(java.lang.String, double), or modify game state as required.- パラメータ:
sim- theCombatSimulatormanaging this event
-
isFinished
boolean isFinished(double currentTime) Returns whether this event has completed and should be removed from the queue. Called byCombatSimulator.advanceTime(double)after each tick.- パラメータ:
currentTime- the current simulation time in seconds- 戻り値:
trueif the event is finished and should not be re-queued
-