Class ConVar<T>
public class ConVar<T> : ConVarBase, IEquatable<ConVarBase>, IEquatable<ConVar<T>>
Type Parameters
T
- Inheritance
-
objectConVar<T>
- Implements
-
IEquatable<ConVar<T>>
- Inherited Members
Constructors
ConVar(ConVarCreationOptions<T>)
public ConVar(ConVarCreationOptions<T> options)
Parameters
optionsConVarCreationOptions<T>
ConVar(string, string, T, ConVarFlags)
public ConVar(string name, string description, T defaultValue, ConVarFlags flags = ConVarFlags.FCVAR_NONE)
Parameters
namestringdescriptionstringdefaultValueTflagsConVarFlags
ConVar(ushort)
public ConVar(ushort accessIndex)
Parameters
accessIndexushort
Properties
MaxValue
Gets or updates the existing upper bound for a numeric, vector, or angle ConVar.
public T MaxValue { get; set; }
Property Value
- T
Remarks
Throws if no upper bound exists or the new maximum is below the minimum. Changes apply to subsequent value assignments; the current value is not reclamped. For native objects, assign a new value rather than modifying the returned object's components.
MinValue
Gets or updates the existing lower bound for a numeric, vector, or angle ConVar.
public T MinValue { get; set; }
Property Value
- T
Remarks
Throws if no lower bound exists or the new minimum exceeds the maximum. Changes apply to subsequent value assignments; the current value is not reclamped. For native objects, assign a new value rather than modifying the returned object's components.
Value
public T Value { get; set; }
Property Value
- T
Methods
Equals(ConVar<T>?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ConVar<T>? other)
Parameters
otherConVar<T>An object to compare with this object.
Returns
Find(string)
public static ConVar<T>? Find(string name)
Parameters
namestring
Returns
- ConVar<T>
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TryGetMaxValue(out T)
Tries to read the upper bound, returning false and default(T) when it is not set.
public bool TryGetMaxValue(out T value)
Parameters
valueT
Returns
Remarks
Invalid ConVars and mismatched value types still throw.
TryGetMinValue(out T)
Tries to read the lower bound, returning false and default(T) when it is not set.
public bool TryGetMinValue(out T value)
Parameters
valueT
Returns
Remarks
Invalid ConVars and mismatched value types still throw.