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