Contents
Interface EventCondition.Ticking
- All Superinterfaces:
EventCondition
- All Known Implementing Classes:
GameFlagLevelCondition, IntervalCondition, LocationCondition, ProximityCondition, TimeCondition, WorldClosedCondition
- Enclosing interface:
EventCondition
A condition that is driven by a repeating tick rather than by events.
Implementations must declare a public static final Type TYPE constant with a
unique ID string and the desired tick interval in seconds. The
ConditionManager
batches all conditions of the same concrete class and dispatches them together at that
interval.
The dt passed to tick(float, Store) is the accumulated time since the last dispatch
for this condition type, which is at least TYPE.tickIntervalSeconds() but may be
slightly longer due to tick timing. Use it for proportional updates (e.g. counting down a
timer) rather than assuming a fixed step.
-
Nested Class Summary
Nested classes/interfaces inherited from interface EventCondition
EventCondition.Config, EventCondition.Event<T>, EventCondition.Ticking, EventCondition.TrackedEvent<T>, EventCondition.Type -
Field Summary
Fields inherited from interface EventCondition
ARRAY_CODEC, EMPTY_ARRAY, TYPE_CODEC -
Method Summary
Modifier and TypeMethodDescriptionvoidtick(float dt, Store<EntityStore> store) Updates the condition's internal state.Methods inherited from interface EventCondition
merge, onCancel, onComplete, onStart, reset, test
-
Method Details
-
tick
Updates the condition's internal state.Set a flag or update a counter here; do not call
EventCondition.test()from within this method. The manager readsEventCondition.test()aftertickreturns.- Parameters:
dt- elapsed seconds since the last tick dispatch for this condition typestore- the entity store for the world the condition is running in
-