![]() |
Public API Reference |
This is an implementation of a virtual clock. More...
#include <csutil/virtclk.h>
Public Member Functions | |
| virtual void | Advance () |
| Advance the engine's virtual-time clock. | |
| virtual csTicks | GetCurrentTicks () const |
| Returns the absolute time of the last call to Advance(). | |
| virtual csTicks | GetElapsedTicks () const |
| Query the time elapsed between the two most recent invocations of Advance(). | |
| virtual void | Resume () |
| Resume the engine's virtual-time clock. | |
| virtual void | Suspend () |
| Suspend the engine's virtual-time clock. | |
This is an implementation of a virtual clock.
Using this clock you can easily keep track of elapsed and current time in a virtual setting.
| virtual void csVirtualClock::Advance | ( | ) | [virtual] |
Advance the engine's virtual-time clock.
Implements iVirtualClock.
| virtual csTicks csVirtualClock::GetCurrentTicks | ( | ) | const [inline, virtual] |
Returns the absolute time of the last call to Advance().
For game logic you should always use this function instead of csGetTicks().
Implements iVirtualClock.
| virtual csTicks csVirtualClock::GetElapsedTicks | ( | ) | const [inline, virtual] |
Query the time elapsed between the two most recent invocations of Advance().
Implements iVirtualClock.
| virtual void csVirtualClock::Resume | ( | ) | [virtual] |
Resume the engine's virtual-time clock.
Call this function when the client application begins invoking Advance() again after extended down-time. This function is the complement of Suspend().
Implements iVirtualClock.
| virtual void csVirtualClock::Suspend | ( | ) | [virtual] |
Suspend the engine's virtual-time clock.
Call this function when the client application will fail to call Advance() for an extended period of time. Suspending the virtual-time clock prevents a temporal anomaly from occurring the next time GetElapsedTicks() is called after the application resumes invoking Advance().
Implements iVirtualClock.