Class SequentialTriggerController<X extends BaseEvent>

java.lang.Object
gg.xp.xivsupport.events.triggers.seq.SequentialTriggerController<X>

public class SequentialTriggerController<X extends BaseEvent> extends Object
  • Constructor Details

  • Method Details

    • accept

      public void accept(Event event)
    • enqueue

      public void enqueue(Event event)
    • waitThenRefreshCombatants

      public void waitThenRefreshCombatants(long delay)
    • refreshCombatants

      public void refreshCombatants()
    • refreshCombatants

      public void refreshCombatants(long delay)
    • forceExpire

      public void forceExpire()
    • stopSilently

      public void stopSilently()
    • waitDuration

      public void waitDuration(Duration duration)
    • waitMs

      public void waitMs(long ms)
    • getLastCall

      @Nullable public @Nullable HasCalloutTrackingKey getLastCall()
    • updateCall

      public void updateCall(CalloutEvent call)
      Accept a new callout event, BUT mark it as "replacing" any previous call i.e. update callout text + emit a new TTS
      Parameters:
      call - The new callout
    • getParams

      public Map<String,Object> getParams()
      Retrives current callout params. Set new values using setParam(String, Object)
      Returns:
      The current callout parameters map
    • setParam

      public void setParam(String name, Object value)
      Sets a parameter which will be passed into ModifiableCallout instances in call(gg.xp.xivsupport.callouts.ModifiableCallout<?>) or updateCall(gg.xp.xivsupport.speech.CalloutEvent).
      Parameters:
      name - The param/variable name
      value - The value
    • updateCall

      public void updateCall(ModifiableCallout<?> call)
      Replace the last call used with updateCall (if any) with this one. Automatically handles parameters set with setParam(String, Object). Equivalent to calling updateCall(call.getModified(getParams()).

      This particular version does not take an event. See updateCall(ModifiableCallout, Object) if you are supplying an event.

      Parameters:
      call - The callout
    • updateCall

      @Contract("null, _ -> null; !null, _ -> !null") @Nullable public <C> @Nullable RawModifiedCallout<C> updateCall(ModifiableCallout<C> call, C event)
      Replace the last call used with updateCall (if any) with this one. Automatically handles parameters set with setParam(String, Object). Equivalent to calling updateCall(call.getModified(event, getParams()).

      This particular version takes an event. See updateCall(ModifiableCallout) if you are NOT supplying an event.

      Parameters:
      call - The callout
      Returns:
      The modified call.
    • call

      @Contract("null -> null; !null -> !null") @Nullable public @Nullable RawModifiedCallout<?> call(ModifiableCallout<?> call)
      Trigger a callout. Does not replace nor is replaced by any other call unless explicitly done by your code. Automatically handles parameters set with setParam(String, Object). Equivalent to calling accept(call.getModified(getParams()).

      This particular version does NOT take an event. See call(ModifiableCallout, Object) if you are supplying an event.

      Parameters:
      call - The callout
      Returns:
      The modified call
    • call

      @Contract("null, _ -> null; !null, _ -> !null") @Nullable public <C> @Nullable RawModifiedCallout<C> call(ModifiableCallout<C> call, C event)
      Trigger a callout. Does not replace nor is replaced by any other call unless explicitly done by your code. Automatically handles parameters set with setParam(String, Object). Equivalent to calling accept(call.getModified(getParams()).

      This particular version takes an event. See call(ModifiableCallout) if you are NOT supplying an event.

      Parameters:
      call - The callout
      Returns:
      The modified call
    • timeSinceStart

      public Duration timeSinceStart()
      Returns:
      The duration since this trigger began
    • updateCall

      public void updateCall(RawModifiedCallout<?> call)
      Accept a new callout event, BUT mark it as "replacing" any previous call i.e. update callout text + emit a new TTS
      Parameters:
      call - The new callout
    • waitEvent

      public <Y> Y waitEvent(Class<Y> eventClass)
    • waitEvent

      public <Y> Y waitEvent(Class<Y> eventClass, Predicate<Y> eventFilter)
    • waitEvents

      public <Y> List<Y> waitEvents(int events, Class<Y> eventClass, Predicate<Y> eventFilter)
    • groupEvents

      public <P extends Predicate<? super Y>, Y> Map<P,List<Y>> groupEvents(int limit, int timeoutMs, Class<Y> eventClass, boolean exclusive, List<P> filters)
      Wait for a certain number of events, but with multiple filters in an 'or' fashion. This method returns a map of filters to a list of events that passed that filter. With 'exclusive' set to true, an event that matches more than one filter will only be assigned to the first in the return value.
      Type Parameters:
      P - The type of filter.
      Y - The type of event.
      Parameters:
      limit - Number of events
      timeoutMs - Timeout in ms to wait for events
      eventClass - Class of event
      exclusive - false if you would like an event to be allowed to match multiple filters, rather than movingn on to the next event after a single match.
      filters - The list of filters.
      Returns:
      A map, where the keys are the filters, and the values are a list of events that matched that filter.
    • collectEvents

      public <Y> void collectEvents(int limit, int timeoutMs, Class<Y> eventClass, boolean exclusive, List<EventCollector<? super Y>> collectors)
      Like groupEvents(int, int, Class, boolean, List), but uses EventCollector objects to filter and collect the result. This method works exactly like groupEvents, but does not return anything. Rather, you would query each of your EventCollectors to see what was matched. Each collector specifies what should be matched, and will be populated with the matches.
      Type Parameters:
      Y - The type of event.
      Parameters:
      limit - Number of events
      timeoutMs - Timeout in ms to wait for events
      eventClass - Class of event
      exclusive - false if you would like an event to be allowed to match multiple filters, rather than moving on to the next event after a single match.
      collectors - The list of collectors.
    • waitEventsQuickSuccession

      public <Y extends BaseEvent> List<Y> waitEventsQuickSuccession(int limit, Class<Y> eventClass, Predicate<Y> eventFilter)
    • waitEventsQuickSuccession

      public <Y extends BaseEvent> List<Y> waitEventsQuickSuccession(int limit, Class<Y> eventClass, Predicate<Y> eventFilter, Duration maxDelta)
    • waitBuffRemoved

      public void waitBuffRemoved(StatusEffectRepository repo, BuffApplied buff)
    • findOrWaitForBuff

      public BuffApplied findOrWaitForBuff(StatusEffectRepository repo, Predicate<BuffApplied> condition)
    • findOrWaitForCast

      public AbilityCastStart findOrWaitForCast(ActiveCastRepository repo, Predicate<AbilityCastStart> condition, boolean includeExpired)
      Find an active cast, or wait for the matching cast to start.
      Parameters:
      repo - The ActiveCastRepository
      condition - The condition for the cast, i.e. the same thing you would feed to waitEvent(java.lang.Class<Y>) and similar methods
      includeExpired - Whether to allow already-completed casts.
      Returns:
      The cast.
    • waitCastFinished

      public BaseEvent waitCastFinished(ActiveCastRepository repo, AbilityCastStart cast)
      Wait for a cast to finish, or return immediately if it already has finished.
      Parameters:
      repo - The ActiveCastRepository
      cast - The cast whose finish you wish to wait for.
      Returns:
      The event that ended the cast. Will usually be an AbilityUsedEvent, but can also be other event types such as AbilityCastCancel for when the cast is interrupted.
    • collectAoeHits

      public List<AbilityUsedEvent> collectAoeHits(Predicate<AbilityUsedEvent> condition)
    • waitEventUntil

      @Nullable public <Y, Z> Y waitEventUntil(Class<Y> eventClass, Predicate<Y> eventFilter, Class<Z> stopOnType, Predicate<Z> stopOn)
    • waitEventsUntil

      public <Y, Z> List<Y> waitEventsUntil(int limit, Class<Y> eventClass, Predicate<Y> eventFilter, Class<Z> stopOnType, Predicate<Z> stopOn)
    • provideEvent

      public void provideEvent(EventContext ctx, X event)
    • isDone

      public boolean isDone()