VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
View.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
VoltMod/Engine/EngineTypes.hpp
>
4
#include <cstdint>
5
6
namespace
VoltMod::Schema
7
{
8
9
/**
10
* @brief Base of every generated schema view: a frame-local pointer into engine memory, never stored.
11
*
12
* The owner is the entity a write notifies, at the owner offset: an entity owns itself at 0, a struct
13
* embedded by value adds its offset, and a sub-object behind a pointer has no owner and notifies
14
* through its own `__m_pChainEntity` link.
15
*/
16
class
View
17
{
18
public
:
19
View
() =
default
;
20
21
/** A standalone object with no known replication route. */
22
explicit
View
(
void
* base) noexcept :
_base
(base) {}
23
24
/** An object at @p ownerOffset inside @p owner. */
25
View
(
void
* base,
::CEntityInstance
* owner, int32_t ownerOffset) noexcept
26
:
_base
(base),
_owner
(owner),
_ownerOffset
(ownerOffset)
27
{}
28
29
/** The only validity check, as on Entity and Pawn. */
30
explicit
operator
bool() const noexcept {
return
_base
!=
nullptr
; }
31
32
/** The object this view points at. */
33
void
*
Base
() const noexcept {
return
_base
; }
34
35
protected
:
36
void
*
_base
=
nullptr
;
37
::CEntityInstance
*
_owner
=
nullptr
;
38
int32_t
_ownerOffset
= 0;
39
};
40
41
}
// namespace VoltMod::Schema
EngineTypes.hpp
VoltMod::Schema::CEntityInstance
Definition
CEntityInstance.hpp:13
VoltMod::Schema::View::View
View(void *base) noexcept
Definition
View.hpp:22
VoltMod::Schema::View::_base
void * _base
Definition
View.hpp:36
VoltMod::Schema::View::_ownerOffset
int32_t _ownerOffset
Definition
View.hpp:38
VoltMod::Schema::View::Base
void * Base() const noexcept
Definition
View.hpp:33
VoltMod::Schema::View::View
View()=default
VoltMod::Schema::View::_owner
::CEntityInstance * _owner
Definition
View.hpp:37
VoltMod::Schema::View::View
View(void *base, ::CEntityInstance *owner, int32_t ownerOffset) noexcept
Definition
View.hpp:25
VoltMod::Schema
Definition
CBaseAnimGraph.hpp:10
include
VoltMod
Schema
View.hpp
Generated by
1.15.0