C# Класс idTech4.idCvarSystem

Console Variables (CVars) are used to hold scalar or string variables that can be changed or displayed at the console as well as accessed directly in code.
CVars are mostly used to hold settings that can be changed from the console or saved to and loaded from configuration files. CVars are also occasionally used to communicate information between different modules of the program.

CVars are restricted from having the same names as console commands to keep the console interface from being ambiguous.

CVars can be accessed from the console in three ways: cvarName prints the current value cvarName X sets the value to X if the variable exists set cvarName X as above, but creates the CVar if not present

CVars may be declared in classes and in functions. However declarations in classes and functions should always be static to save space and time. Making CVars static does not change their functionality due to their global nature.

CVars should be contructed only through one of the constructors with name, value, flags and description. The name, value and description parameters to the constructor have to be static strings, do not use va() or the like functions returning a string.

CVars may be declared multiple times using the same name string. However, they will all reference the same value and changing the value of one CVar changes the value of all CVars with the same name.

CVars should always be declared with the correct type flag: CVAR_BOOL, CVAR_INTEGER or CVAR_FLOAT. If no such flag is specified the CVar defaults to type string. If the CVAR_BOOL flag is used there is no need to specify an argument auto-completion function because the CVar gets one assigned automatically.

CVars are automatically range checked based on their type and any min/max or valid string set specified in the constructor.

CVars are always considered cheats except when CVAR_NOCHEAT, CVAR_INIT, CVAR_ROM, CVAR_ARCHIVE, CVAR_USERINFO, CVAR_SERVERINFO, CVAR_NETWORKSYNC is set.

Показать файл Открыть проект

Открытые методы

Метод Описание
ArgCompletion ( string name, string argText ) : string[]
ClearModified ( string name ) : void
Command ( idCmdArgs args ) : bool

Called by the command system when a command is unrecognized.

CommandCompletion ( Predicate filter ) : string[]
CopyCvarsToDictionary ( idDict dict, CvarFlags flags ) : void
Find ( string name ) : idCvar
GetBool ( string name ) : bool
GetFloat ( string name ) : float
GetInteger ( string name ) : int
GetString ( string name ) : string
Init ( ) : void
IsModified ( string name ) : bool
Register ( idCvar var ) : void
RegisterStatics ( ) : void
SetBool ( string name, bool value, CvarFlags flags ) : void
SetFloat ( string name, float value, CvarFlags flags ) : void
SetInteger ( string name, int value, CvarFlags flags ) : void
SetModified ( string name ) : void
SetString ( string name, string value, CvarFlags flags ) : void
idCvarSystem ( ) : System

Приватные методы

Метод Описание
Cmd_List ( object sender, CommandEventArgs e ) : void
Cmd_Reset ( object sender, CommandEventArgs e ) : void
Cmd_Restart ( object sender, CommandEventArgs e ) : void
Cmd_Set ( object sender, CommandEventArgs e ) : void
Cmd_SetA ( object sender, CommandEventArgs e ) : void
Cmd_SetS ( object sender, CommandEventArgs e ) : void
Cmd_SetT ( object sender, CommandEventArgs e ) : void
Cmd_SetU ( object sender, CommandEventArgs e ) : void
Cmd_Toggle ( object sender, CommandEventArgs e ) : void
FindInternal ( string name, bool ignoreMissing = false ) : idInternalCvar
ListByFlags ( idCmdArgs args, CvarFlags flags ) : void
SetInternal ( string name, string value, CvarFlags flags ) : void

Описание методов

ArgCompletion() публичный Метод

public ArgCompletion ( string name, string argText ) : string[]
name string
argText string
Результат string[]

ClearModified() публичный Метод

public ClearModified ( string name ) : void
name string
Результат void

Command() публичный Метод

Called by the command system when a command is unrecognized.
public Command ( idCmdArgs args ) : bool
args idCmdArgs
Результат bool

CommandCompletion() публичный Метод

public CommandCompletion ( Predicate filter ) : string[]
filter Predicate
Результат string[]

CopyCvarsToDictionary() публичный Метод

public CopyCvarsToDictionary ( idDict dict, CvarFlags flags ) : void
dict idDict
flags CvarFlags
Результат void

Find() публичный Метод

public Find ( string name ) : idCvar
name string
Результат idCvar

GetBool() публичный Метод

public GetBool ( string name ) : bool
name string
Результат bool

GetFloat() публичный Метод

public GetFloat ( string name ) : float
name string
Результат float

GetInteger() публичный Метод

public GetInteger ( string name ) : int
name string
Результат int

GetString() публичный Метод

public GetString ( string name ) : string
name string
Результат string

Init() публичный Метод

public Init ( ) : void
Результат void

IsModified() публичный Метод

public IsModified ( string name ) : bool
name string
Результат bool

Register() публичный Метод

public Register ( idCvar var ) : void
var idCvar
Результат void

RegisterStatics() публичный Метод

public RegisterStatics ( ) : void
Результат void

SetBool() публичный Метод

public SetBool ( string name, bool value, CvarFlags flags ) : void
name string
value bool
flags CvarFlags
Результат void

SetFloat() публичный Метод

public SetFloat ( string name, float value, CvarFlags flags ) : void
name string
value float
flags CvarFlags
Результат void

SetInteger() публичный Метод

public SetInteger ( string name, int value, CvarFlags flags ) : void
name string
value int
flags CvarFlags
Результат void

SetModified() публичный Метод

public SetModified ( string name ) : void
name string
Результат void

SetString() публичный Метод

public SetString ( string name, string value, CvarFlags flags ) : void
name string
value string
flags CvarFlags
Результат void

idCvarSystem() публичный Метод

public idCvarSystem ( ) : System
Результат System