C# Class hyades.utils.Timer

An object that invokes an action after an amount of time has elapsed and optionally continues repeating until told to stop.
Show file Open project: zfedoran/bubblebound Class Usage Examples

Public Properties

Property Type Description
tag object
tickLength float
time float

Public Methods

Method Description
ForceTick ( ) : void

Forces the timer to fire its tick event, invalidating the timer unless it is set to repeat.

Stop ( ) : void

Stops the timer.

Timer ( float length, bool repeats, Action tick ) : System

Creates a new Timer.

Update ( double elapsed ) : void

Updates the timer.

Private Methods

Method Description
Reset ( float l, bool r, Action t ) : void
Timer ( ) : System

Method Details

ForceTick() public method

Forces the timer to fire its tick event, invalidating the timer unless it is set to repeat.
public ForceTick ( ) : void
return void

Stop() public method

Stops the timer.
public Stop ( ) : void
return void

Timer() public method

Creates a new Timer.
public Timer ( float length, bool repeats, Action tick ) : System
length float The length of time between ticks.
repeats bool Whether or not the timer repeats.
tick Action The delegate to invoke when the timer ticks.
return System

Update() public method

Updates the timer.
public Update ( double elapsed ) : void
elapsed double
return void

Property Details

tag public property

public object tag
return object

tickLength public property

public float tickLength
return float

time public property

public float time
return float