Interface HasDuration

All Known Implementing Classes:
AbilityCastStart, BuffApplied, CastTracker, CountdownStartedEvent, TimelineProcessor.UpcomingTrigger

public interface HasDuration
Represents something with a duration.
  • Method Details

    • getInitialDuration

      Duration getInitialDuration()
      Returns:
      The initial duration at the time of the event happening.
    • getEstimatedElapsedDuration

      default Duration getEstimatedElapsedDuration()
      Returns:
      The elapsed duration. Note that this takes getEffectiveTimeSince() into account, so it will respect fake time sources.

      Note that this is bounded. It will never return a value less than Duration.ZERO, nor a value greater than getInitialDuration().

    • getEstimatedRemainingDuration

      default Duration getEstimatedRemainingDuration()
      Returns:
      The elapsed duration. Note that this takes getEffectiveTimeSince() into account, so it will respect fake time sources.
    • remainingDurationPlus

      default Duration remainingDurationPlus(Duration offset)
      Like getEstimatedRemainingDuration(), but instead of using the normal expiry time, it offsets from the normal.
      Parameters:
      offset - The duration offset. Positive means later, negative means earlier.
      Returns:
      The remaining duration until the expiry time plus this offset, not to exceed 'offset' nor be negative.
    • getEstimatedTimeSinceExpiry

      default Duration getEstimatedTimeSinceExpiry()
      Returns:
      The time between the current time, and when the duration should have expired. If called before expiry time, behavior is undefined.
    • getEffectiveTimeSince

      Duration getEffectiveTimeSince()
      Must be implemented.
      Returns:
      The time since this event has occurred.
    • wouldBeExpired

      default boolean wouldBeExpired()
      Returns:
      true if and only if the current time is later than this event should have hit its full duration.
    • isIndefinite

      default boolean isIndefinite()