Interface HasDuration
- All Known Implementing Classes:
AbilityCastStart
,BuffApplied
,CastTracker
,CountdownStartedEvent
,TimelineProcessor.UpcomingTrigger
public interface HasDuration
Represents something with a duration.
-
Method Summary
Modifier and TypeMethodDescriptionMust be implemented.default Duration
default Duration
default Duration
default boolean
default Duration
remainingDurationPlus
(Duration offset) LikegetEstimatedRemainingDuration()
, but instead of using the normal expiry time, it offsets from the normal.default boolean
-
Method Details
-
getInitialDuration
Duration getInitialDuration()- Returns:
- The initial duration at the time of the event happening.
-
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 thangetInitialDuration()
.
-
getEstimatedRemainingDuration
- Returns:
- The elapsed duration. Note that this takes
getEffectiveTimeSince()
into account, so it will respect fake time sources.
-
remainingDurationPlus
LikegetEstimatedRemainingDuration()
, 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
- 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()
-