Skip to main content

TickTimer

A class in Root.Township, the global namespace.

Repeating timer on the game Timeline that fires Ticked at a fixed interval, and can be saved and reloaded with the world.

Constructors​

MemberWhat it is
TickTimer(TimeSpan interval)Creates a TickTimer from interval.

Fields​

2 private and internal fields
MemberWhat it is
private Timeline.IEntry entryThe current timeline entry.
private TimeSpan intervalTime between ticks.

Events​

MemberWhat it is
event Action TickedRaised every interval.

Methods​

MemberWhat it is
int Load(TimeSpan time)Restarts from a saved time and returns how many ticks were missed while unloaded. It doesn't fire them.
TimeSpan Save()Returns the time of the next tick, for saving.
void Start()Restarts the timer, first tick one interval from now.
void Stop()Cancels the timeline entry.
1 private and internal method
MemberWhat it is
private void Tick()Raises Ticked.

Used in​

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