VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::KeyValues Class Reference

Spawn keyvalues such as "origin", "spawnflags" or "effect_name". More...

#include <KeyValues.hpp>

Public Member Functions

 KeyValues ()
 
 ~KeyValues ()
 
 KeyValues (const KeyValues &)=delete
 
KeyValues & operator= (const KeyValues &)=delete
 
KeyValues & Set (std::string_view key, std::string_view value)
 
KeyValues & Set (std::string_view key, const char *value)
 
KeyValues & Set (std::string_view key, int value)
 
KeyValues & Set (std::string_view key, float value)
 
KeyValues & Set (std::string_view key, bool value)
 
KeyValues & Set (std::string_view key, const Vector &value)
 
KeyValues & Set (std::string_view key, const QAngle &value)
 
KeyValues & Set (std::string_view key, const Color &value)
 
CEntityKeyValues * Raw () const
 
CEntityKeyValues * Detach ()
 

Detailed Description

Spawn keyvalues such as "origin", "spawnflags" or "effect_name".

Owns the engine object until a spawn takes it; one that never spawns frees it.

Definition at line 15 of file KeyValues.hpp.

Constructor & Destructor Documentation

◆ KeyValues() [1/2]

VoltMod::KeyValues::KeyValues ( )

Definition at line 10 of file KeyValues.cpp.

◆ ~KeyValues()

VoltMod::KeyValues::~KeyValues ( )

Definition at line 12 of file KeyValues.cpp.

◆ KeyValues() [2/2]

VoltMod::KeyValues::KeyValues ( const KeyValues &  )
delete

Member Function Documentation

◆ Detach()

CEntityKeyValues * VoltMod::KeyValues::Detach ( )

Hand the object to the engine's spawn, which frees it.

Definition at line 87 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ operator=()

KeyValues & VoltMod::KeyValues::operator= ( const KeyValues &  )
delete

◆ Raw()

CEntityKeyValues * VoltMod::KeyValues::Raw ( ) const
inline

The wrapped object; nullptr after Detach().

Definition at line 39 of file KeyValues.hpp.

◆ Set() [1/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
bool  value 
)

Definition at line 51 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ Set() [2/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
const char *  value 
)
inline

Without this a string literal picks the bool overload and sets "true".

Definition at line 26 of file KeyValues.hpp.

References VoltMod::ReadFile(), and Set().

◆ Set() [3/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
const Color &  value 
)

◆ Set() [4/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
const QAngle &  value 
)

Definition at line 69 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ Set() [5/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
const Vector &  value 
)

Definition at line 60 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ Set() [6/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
float  value 
)

Definition at line 42 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ Set() [7/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
int  value 
)

Definition at line 33 of file KeyValues.cpp.

References VoltMod::ReadFile().

◆ Set() [8/8]

KeyValues & VoltMod::KeyValues::Set ( std::string_view  key,
std::string_view  value 
)

The documentation for this class was generated from the following files: