C#Code
C#Code
Public Member Functions | Protected Attributes | Private Attributes
Libraries.Timers.BaseTimer Class Reference

List of all members.

Public Member Functions

 BaseTimer (UInt64 timeToWait, bool restartOnEnd, bool clearFinishedOnUpdate)
bool Update (UInt64 passed)
bool GetIsFinished ()
UInt64 GetTimePassed ()
void Restart ()
void SetPaused (bool pause)
bool GetIsPaused ()
double GetPercentPassed ()
UInt64 GetTimeToWait ()
void SetTimeToWait (UInt64 timeToWait)
 BaseTimer (UInt64 timeToWait, bool restartOnEnd, bool clearFinishedOnUpdate)
bool Update (UInt64 passed)
bool GetIsFinished ()
UInt64 GetTimePassed ()
void Restart ()
void SetPaused (bool pause)
bool GetIsPaused ()

Protected Attributes

UInt64 m_timePassed
 How long the timer has been running.
UInt64 m_timeToWait
 How long the timer should wait.

Private Attributes

bool m_restartOnEnd
 True if the timer should restart when it hits the end, false if not.
bool m_finished
 wether the timer finished. True if it did, false if not.
bool m_paused
 True if the timer is paused, false if not.
bool m_clearFinishedOnUpdate
 True if the m_finished flag should always be set to false on update, false if not.

Detailed Description

A base class for creating timers. Can be used as is. Handles checking if a given time has passed. Can have different ways of handling, like restarting if the time has passed, stopping, etc. Anytime a timer is done I should use this.


Constructor & Destructor Documentation

Libraries.Timers.BaseTimer.BaseTimer ( UInt64  timeToWait,
bool  restartOnEnd,
bool  clearFinishedOnUpdate 
)

Setup the timer, how long to wait and other properties.

timeToWait - How long the timer needs to wait.
restartOnEnd - True if the timer should restart when it reaches the time to wait, false if not.
clearFinishedOnUpdate - True if the finished flag should be reset to false at the start of the update function, false if it is left alone.
Libraries.Timers.BaseTimer.BaseTimer ( UInt64  timeToWait,
bool  restartOnEnd,
bool  clearFinishedOnUpdate 
)

Setup the timer, how long to wait and other properties.

timeToWait - How long the timer needs to wait.
restartOnEnd - True if the timer should restart when it reaches the time to wait, false if not.
clearFinishedOnUpdate - True if the finished flag should be reset to false at the start of the update function, false if it is left alone.

Member Function Documentation

bool Libraries.Timers.BaseTimer.GetIsFinished ( )

Get the flag that shows if the timer finished. Finshed just means that the time passed is >= the time to wait. If the timer is set to restart it is finished each time it restarts.
Return:
Value is true if the timer finished, false if not.

bool Libraries.Timers.BaseTimer.GetIsFinished ( )

Get the flag that shows if the timer finished. Finshed just means that the time passed is >= the time to wait. If the timer is set to restart it is finished each time it restarts.
Return:
Value is true if the timer finished, false if not.

bool Libraries.Timers.BaseTimer.GetIsPaused ( )

Get wether the timer is paused. Return:

Value is true if the timer is paused, false if not.

bool Libraries.Timers.BaseTimer.GetIsPaused ( )

Get wether the timer is paused. Return:

Value is true if the timer is paused, false if not.

double Libraries.Timers.BaseTimer.GetPercentPassed ( )

Get the time passed as a percentage. Return:

Value is the time passed in percentage form, where 0 is not time has passed and 1 is time has completly passed.

UInt64 Libraries.Timers.BaseTimer.GetTimePassed ( )

Get how long the timer has been running.

Return:
Value is how long the timer has been running.

UInt64 Libraries.Timers.BaseTimer.GetTimePassed ( )

Get how long the timer has been running.

Return:
Value is how long the timer has been running.

UInt64 Libraries.Timers.BaseTimer.GetTimeToWait ( )

Get the base amount of time the timer waits, in total, to finish. Return:

Value is the base amount of time the timer waits when started.

void Libraries.Timers.BaseTimer.Restart ( )

Restart the timer.

void Libraries.Timers.BaseTimer.Restart ( )

Restart the timer.

void Libraries.Timers.BaseTimer.SetPaused ( bool  pause)

Set the timer to be paused/running.

pause - Value is true if the timer is paused, false if not.
void Libraries.Timers.BaseTimer.SetPaused ( bool  pause)

Set the timer to be paused/running.

pause - Value is true if the timer is paused, false if not.
void Libraries.Timers.BaseTimer.SetTimeToWait ( UInt64  timeToWait)

Set the amount of time the timer checks for passing. This doesn't reset time passed or other flags, so make sure to restart the timer if that is what you want.

timeToWait - How long the timer should be set to wait.
bool Libraries.Timers.BaseTimer.Update ( UInt64  passed)

Update the timer. Resets the finished flag if it was already set from the previous update if the clear finished flag is set.

passed - How long has passed.

Return:
Value is true if the timer finished, false if not.
bool Libraries.Timers.BaseTimer.Update ( UInt64  passed)

Update the timer. Resets the finished flag if it was already set from the previous update if the clear finished flag is set.

passed - How long has passed.

Return:
Value is true if the timer finished, false if not.

Member Data Documentation

True if the m_finished flag should always be set to false on update, false if not.

wether the timer finished. True if it did, false if not.

True if the timer is paused, false if not.

True if the timer should restart when it hits the end, false if not.

How long the timer has been running.

How long the timer should wait.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties