Class SqtTemplates
java.lang.Object
gg.xp.xivsupport.events.triggers.seq.SqtTemplates
-
Method Summary
Modifier and TypeMethodDescriptionstatic SequentialTrigger<BaseEvent>
beginningAndEndingOfCast
(Predicate<AbilityCastStart> castFilter, ModifiableCallout<? super AbilityCastStart> initialCall, ModifiableCallout<?> followup) Trigger template for when you want one call at the start of a cast bar, then another call at the end of the cast bar.static <X extends HasDuration>
SequentialTrigger<BaseEvent>callWhenDurationIs
(Class<X> eventType, Predicate<X> eventFilter, ModifiableCallout<? super X> callout, Duration targetDuration) Given an event with a duration, trigger the given callout when the duration dips below the given duration.static <X> SequentialTrigger<BaseEvent>
multiInvocation
(int timeoutMs, Class<X> startType, Predicate<X> startCondition, BiConsumer<X, SequentialTriggerController<BaseEvent>>... triggers) Trigger template for when the same event might indicate different things in a fight.static SequentialTrigger<BaseEvent>
nothing()
static <X> SequentialTrigger<BaseEvent>
sq
(int timeoutMs, Class<X> startType, Predicate<X> startCondition, BiConsumer<X, SequentialTriggerController<BaseEvent>> trigger) Convenience function for making a typical sequential controller.
-
Method Details
-
callWhenDurationIs
public static <X extends HasDuration> SequentialTrigger<BaseEvent> callWhenDurationIs(Class<X> eventType, Predicate<X> eventFilter, ModifiableCallout<? super X> callout, Duration targetDuration) Given an event with a duration, trigger the given callout when the duration dips below the given duration.- Type Parameters:
X
- Event type- Parameters:
eventType
- Event typeeventFilter
- Event filtercallout
- The callout to triggertargetDuration
- The duration at which to call out- Returns:
- The constructed trigger
-
sq
public static <X> SequentialTrigger<BaseEvent> sq(int timeoutMs, Class<X> startType, Predicate<X> startCondition, BiConsumer<X, SequentialTriggerController<BaseEvent>> trigger) Convenience function for making a typical sequential controller.Unlike using a raw
SequentialTrigger
, this provides an auto-reset-on-wipe, as well as handling type safety of the initial event since it is typically recommended to use a more broad type (e.g. BaseEvent) as the generic type, while the start event is more specific.- Type Parameters:
X
- The start event type- Parameters:
timeoutMs
- TimeoutstartType
- Starting event typestartCondition
- Starting event conditiontrigger
- The trigger code- Returns:
- The constructed Sequential Trigger
-
multiInvocation
public static <X> SequentialTrigger<BaseEvent> multiInvocation(int timeoutMs, Class<X> startType, Predicate<X> startCondition, BiConsumer<X, SequentialTriggerController<BaseEvent>>... triggers) Trigger template for when the same event might indicate different things in a fight.The first time this is called, it will execute the first instance in the 'triggers' array. The second time, it will execute the second, and so on. It will reset back to the first on a wipe/reset.
- Type Parameters:
X
- Start event type.- Parameters:
timeoutMs
- Timeout. This is the same for each individual trigger, so you should use the highest value that any individual invocation needs.startType
- Start event type.startCondition
- Start event condition.triggers
- Array of triggers to be fired in order when we see the start event. These will work exactly like normal sequential triggers, but will be used sequentially.- Returns:
- The constructed trigger.
-
beginningAndEndingOfCast
public static SequentialTrigger<BaseEvent> beginningAndEndingOfCast(Predicate<AbilityCastStart> castFilter, ModifiableCallout<? super AbilityCastStart> initialCall, ModifiableCallout<?> followup) Trigger template for when you want one call at the start of a cast bar, then another call at the end of the cast bar.Note that this uses the cast duration ONLY - it does not check to see if the ability has actually gone off or not.
- Parameters:
castFilter
- What cast to look forinitialCall
- Initial callfollowup
- Followup call- Returns:
- The constructed trigger
-
nothing
-