3#include <Foundation/Configuration/CVar.h>
5template <
typename Type, plCVarType::Enum CVarType>
7 :
plCVar(sName, flags, sDescription)
9 PL_ASSERT_DEBUG(sName.
FindSubString(
" ") ==
nullptr,
"CVar names must not contain whitespace");
11 for (plUInt32 i = 0; i < plCVarValue::ENUM_COUNT; ++i)
15template <
typename Type, plCVarType::Enum CVarType>
21template <
typename Type, plCVarType::Enum CVarType>
27template <
typename Type, plCVarType::Enum CVarType>
38 m_CVarEvents.Broadcast(e);
41 s_AllCVarEvents.Broadcast(e);
44template <
typename Type, plCVarType::Enum CVarType>
47 return (m_Values[val]);
50template <
typename Type, plCVarType::Enum CVarType>
73 m_CVarEvents.Broadcast(e);
76 s_AllCVarEvents.Broadcast(e);
CVars are global variables that are used for configuring the engine.
Definition CVar.h:109
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
const char * FindSubString(plStringView sStringToFind, const char *szStartSearchAt=nullptr) const
Definition StringView.cpp:60
[internal] Helper class to implement plCVarInt, plCVarFlag, plCVarBool and plCVarString.
Definition CVar.h:267
void operator=(const Type &value)
Changes the CVar's value and broadcasts the proper events.
Definition CVar_inl.h:51
virtual void SetToDelayedSyncValue() override
Copies the 'DelayedSync' value into the 'Current' value.
Definition CVar_inl.h:28
const Type & GetValue(plCVarValue::Enum val=plCVarValue::Current) const
Returns the internal values of the CVar.
Definition CVar_inl.h:45
virtual plCVarType::Enum GetType() const override
Returns the type of the CVar.
Definition CVar_inl.h:22
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
The data that is broadcast whenever a cvar is changed.
Definition CVar.h:65
@ DelayedSyncValueChanged
Sent whenever the 'DelayedSync' value of the CVar changes. It might actually change back to the 'Curr...
Definition CVar.h:74
@ ValueChanged
Sent whenever the 'Current' value of the CVar is changed.
Definition CVar.h:73
@ RequiresDelayedSync
If the CVar value is changed, the new value will not be visible by default, until SetToDelayedSyncVal...
Definition CVar.h:40
Enum
Definition CVar.h:255
@ Current
The value that should be used.
Definition CVar.h:256
@ DelayedSync
The state that will be stored for later. This is identical to 'Current' unless the 'RequiresDelayedSy...
Definition CVar.h:259