VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Clock.cpp
Go to the documentation of this file.
3#include <engine2/gameshareddefs.h>
4
5namespace VoltMod
6{
7
8Clock::Clock(Interfaces& interfaces) : _interfaces(interfaces) {}
9
10CGlobalVars* Clock::Globals() const
11{
12 return _interfaces.Engine ? _interfaces.Engine->GetServerGlobals() : nullptr;
13}
14
15int Clock::Tick() const
16{
17 auto* globals = Globals();
18 return globals ? globals->tickcount : 0;
19}
20
21float Clock::Time() const
22{
23 auto* globals = Globals();
24 return globals ? globals->curtime : 0.0f;
25}
26
27} // namespace VoltMod
float Time() const
Definition Clock.cpp:21
int Tick() const
Definition Clock.cpp:15
Clock(Interfaces &interfaces)
Definition Clock.cpp:8
CGlobalVars * Globals() const
Definition Clock.cpp:10
Centralized holder for all SDK interface pointers.