VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
ConVarTypes.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6namespace VoltMod
7{
8
9/**
10 * SDK-free mirror of `EConVarType` used by handle validation and console parsing.
11 * ConVar.cpp verifies every value against the SDK with static_asserts.
12 */
13enum class ConVarType : int16_t
14{
15 Invalid = -1,
16 Bool,
17 Int16,
18 UInt16,
19 Int32,
20 UInt32,
21 Int64,
22 UInt64,
23 Float32,
24 Float64,
25 String,
26 Color,
27 Vector2,
28 Vector3,
29 Vector4,
30 QAngle,
32};
33
34/**
35 * Whether a handle for @p T can access engine kind @p type.
36 *
37 * All integer kinds use `int`; the engine accessor preserves their storage width. Bool remains a
38 * separate kind because accepting an `int` handle for it silently drops writes.
39 */
40template <class T>
42
43} // namespace VoltMod
@ Invalid
The caller's input does not parse or does not satisfy a precondition.
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
::QAngle QAngle
Definition Math.hpp:14
bool ConVarTypeMatches(ConVarType type)
An RGBA color in the engine's byte order, as m_clrRender and glow colors hold it.
Definition Color.hpp:15