VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
EntityRef.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
namespace
VoltMod
6
{
7
8
/** An entity handle that is safe to keep across frames: it resolves to nothing once its entity is gone,
9
* even if another entity reuses the slot. `EntityRef{}` clears a handle field. */
10
struct
EntityRef
11
{
12
static
constexpr
uint32_t
Unset
= 0xFFFFFFFFu;
13
14
/** The engine's CHandle bits. */
15
uint32_t
Handle
=
Unset
;
16
17
explicit
operator
bool
()
const
noexcept
{
return
Handle
!=
Unset
; }
18
bool
operator==
(
const
EntityRef
&)
const
noexcept
=
default
;
19
};
20
21
// Generated accessors read and write it in place of the engine's CHandle.
22
static_assert
(
sizeof
(
EntityRef
) == 4);
23
24
}
// namespace VoltMod
VoltMod
Definition
Options.hpp:13
VoltMod::ReadFile
static std::string ReadFile(const std::filesystem::path &path)
Definition
Loader.cpp:56
VoltMod::EntityRef
Definition
EntityRef.hpp:11
VoltMod::EntityRef::Unset
static constexpr uint32_t Unset
Definition
EntityRef.hpp:12
VoltMod::EntityRef::Handle
uint32_t Handle
Definition
EntityRef.hpp:15
VoltMod::EntityRef::operator==
bool operator==(const EntityRef &) const noexcept=default
include
VoltMod
Engine
EntityRef.hpp
Generated by
1.9.8