SwiftlyS2

IConVar

Interface IConVar

Namespace: SwiftlyS2.Shared.Convars

Assembly: SwiftlyS2.CS2.dll

public interface IConVar<T> : IConVar
Type Parameters
  • T

Implements

Properties

DefaultValue

The default value of the convar.

T DefaultValue { get; set; }
Property Value
  • T

Flags

The flags of the convar.

ConvarFlags Flags { get; set; }
Property Value

HasDefaultValue

Whether the convar has a default value.

bool HasDefaultValue { get; }
Property Value

HasMaxValue

Whether the convar has a max value.

bool HasMaxValue { get; }
Property Value

HasMinValue

Whether the convar has a min value.

bool HasMinValue { get; }
Property Value

MaxValue

The max value of the convar.

Thrown when the convar is not a min/max type or doesn't have a max value.

T MaxValue { get; set; }
Property Value
  • T

MinValue

The min value of the convar.

Thrown when the convar is not a min/max type or doesn't have a min value.

T MinValue { get; set; }
Property Value
  • T

Value

The value of the convar. When setting, if the convar can be replicated, it will automatically replicate to all clients. Also, setting value with this method will internally put it into a set queue, Which means that for some special case ( e.g. setting sv_enablebunnyhopping inside a hook ) it won't work, in such cases you should use the SetInternal method instead.

T Value { get; set; }
Property Value
  • T

Methods

QueryClient(int, Action<string>)

Query the value of the convar from specified client.

void QueryClient(int clientId, Action<string> callback)
Parameters

ReplicateToClient(int, T)

Replicate the value of the convar to specified client.

void ReplicateToClient(int clientId, T value)
Parameters
  • clientId int — The client id to replicate to.
  • value T

SetInternal(T)

Internally set the value of the convar. Won't replicate the change to clients.

void SetInternal(T value)
Parameters
  • value T — The value to set.

TryGetDefaultValue(out T)

Try to get the default value of the convar.

bool TryGetDefaultValue(out T defaultValue)
Parameters
  • defaultValue T — The default value of the convar.
Returns
  • bool — True if the default value is found, false otherwise.

TryGetMaxValue(out T)

Try to get the max value of the convar.

bool TryGetMaxValue(out T maxValue)
Parameters
  • maxValue T — The max value of the convar.
Returns
  • bool — True if the max value is found, false otherwise.

TryGetMinValue(out T)

Try to get the min value of the convar.

bool TryGetMinValue(out T minValue)
Parameters
  • minValue T — The min value of the convar.
Returns
  • bool — True if the min value is found, false otherwise.

On this page