Interface EventCondition.Ticking

All Superinterfaces:
EventCondition
All Known Implementing Classes:
GameFlagLevelCondition, IntervalCondition, LocationCondition, ProximityCondition, TimeCondition, WorldClosedCondition
Enclosing interface:
EventCondition

public static interface EventCondition.Ticking extends 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.

  • Method Details

    • tick

      void tick(float dt, @Nonnull Store<EntityStore> store)
      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 reads EventCondition.test() after tick returns.

      Parameters:
      dt - elapsed seconds since the last tick dispatch for this condition type
      store - the entity store for the world the condition is running in