Skip to main content

OffsetEvent

A class in Root.Township, Alta.Woodcutting.

Debounced call on a Timeline: runs an action once Offset hasn't been called for a minimum delay. Made with Timeline.CreateOffset.

Constructors​

MemberWhat it is
OffsetEvent(Timeline timeline, TimeSpan minimumDelay, TimeSpan offsetDelay, Action delayedEvent)Creates an OffsetEvent from timeline, minimumDelay, offsetDelay and delayedEvent.

Fields​

5 private and internal fields
MemberWhat it is
private Action delayedEventThe action to run.
private TimeSpan lastOffsetTimeline time of the last Offset (or creation).
private TimeSpan minimumDelayQuiet time needed after the last offset before the action runs.
private TimeSpan offsetDelayDelay before each check.
private Timeline timelineTimeline used for timing and scheduling checks.

Methods​

MemberWhat it is
void Offset()Pushes the action back, counting the delay from now.
1 private and internal method
MemberWhat it is
private void Check()Runs the action if enough time has passed since the last offset, otherwise checks again later.

Used in​

Members of other types that take, return or hold a OffsetEvent: