|
VoltMod
C++23 framework for CS2 server plugins
|
The engine's simulation clock, read straight from IVEngineServer2::GetServerGlobals(). More...
#include <Clock.hpp>
Public Member Functions | |
| Clock (Interfaces &interfaces) | |
| Clock (const Clock &)=delete | |
| Clock & | operator= (const Clock &)=delete |
| CGlobalVars * | Globals () const |
| int | Tick () const |
| float | Time () const |
The engine's simulation clock, read straight from IVEngineServer2::GetServerGlobals().
Holds no state of its own - every call reads the engine live. It is the timestamp source for anything that must line up with the tick the engine is simulating. Both readings reset when a map starts, so never persist a value across a map change.
Exposed as runtime.Clock.
|
explicit |
| CGlobalVars * VoltMod::Clock::Globals | ( | ) | const |
The engine's CGlobalVars, or nullptr before load / after shutdown.
Definition at line 10 of file Clock.cpp.
References VoltMod::Interfaces::Engine.
| int VoltMod::Clock::Tick | ( | ) | const |
| float VoltMod::Clock::Time | ( | ) | const |
Current simulation time in seconds (curtime), or 0 when the globals are unavailable.
Definition at line 21 of file Clock.cpp.
References Globals().
Referenced by VoltMod::Rounds::TimeLeft().