RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Member Functions | Private Attributes
RoR::CVar Class Reference

Quake-style console variable, defined in RoR.cfg or crated via Console UI and scripts. More...

#include <CVar.h>

Public Member Functions

 CVar (std::string const &name, std::string const &long_name, int flags)
 
template<typename T >
void setVal (T val)
 
void setStr (std::string const &str)
 
std::string const & getStr () const
 
float getFloat () const
 
int getInt () const
 
bool getBool () const
 
template<typename T >
getEnum () const
 
std::string const & getName () const
 
std::string const & getLongName () const
 
bool hasFlag (int f) const
 

Private Member Functions

void logUpdate (std::string const &new_val)
 
std::string convertStr (float val)
 

Private Attributes

std::string m_name
 
std::string m_long_name
 
std::string m_value_str
 
float m_value_num
 
int m_flags
 

Detailed Description

Quake-style console variable, defined in RoR.cfg or crated via Console UI and scripts.

Inspired by Quake II:

Author
Petr Ohlidal, 2020

Definition at line 52 of file CVar.h.

Constructor & Destructor Documentation

◆ CVar()

RoR::CVar::CVar ( std::string const &  name,
std::string const &  long_name,
int  flags 
)
inline

Definition at line 56 of file CVar.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ convertStr()

std::string CVar::convertStr ( float  val)
private

Definition at line 299 of file CVar.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBool()

bool RoR::CVar::getBool ( ) const
inline

Definition at line 98 of file CVar.h.

+ Here is the caller graph for this function:

◆ getEnum()

template<typename T >
T RoR::CVar::getEnum ( ) const
inline

Definition at line 99 of file CVar.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFloat()

float RoR::CVar::getFloat ( ) const
inline

Definition at line 96 of file CVar.h.

+ Here is the caller graph for this function:

◆ getInt()

int RoR::CVar::getInt ( ) const
inline

Definition at line 97 of file CVar.h.

+ Here is the caller graph for this function:

◆ getLongName()

std::string const& RoR::CVar::getLongName ( ) const
inline

Definition at line 104 of file CVar.h.

◆ getName()

std::string const& RoR::CVar::getName ( ) const
inline

Definition at line 103 of file CVar.h.

+ Here is the caller graph for this function:

◆ getStr()

std::string const& RoR::CVar::getStr ( ) const
inline

Definition at line 95 of file CVar.h.

+ Here is the caller graph for this function:

◆ hasFlag()

bool RoR::CVar::hasFlag ( int  f) const
inline

Definition at line 105 of file CVar.h.

+ Here is the caller graph for this function:

◆ logUpdate()

void CVar::logUpdate ( std::string const &  new_val)
private

Definition at line 287 of file CVar.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStr()

void RoR::CVar::setStr ( std::string const &  str)
inline

Definition at line 83 of file CVar.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setVal()

template<typename T >
void RoR::CVar::setVal ( val)
inline

Definition at line 72 of file CVar.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_flags

int RoR::CVar::m_flags
private

Definition at line 118 of file CVar.h.

◆ m_long_name

std::string RoR::CVar::m_long_name
private

Definition at line 114 of file CVar.h.

◆ m_name

std::string RoR::CVar::m_name
private

Definition at line 113 of file CVar.h.

◆ m_value_num

float RoR::CVar::m_value_num
private

Definition at line 117 of file CVar.h.

◆ m_value_str

std::string RoR::CVar::m_value_str
private

Definition at line 116 of file CVar.h.


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