Table of Contents

Class RangeValidator<T>

Namespace
SteamNetworkLib.Sync
Assembly
SteamNetworkLib.dll

Validator for numeric ranges.

public class RangeValidator<T> : ISyncValidator<T> where T : IComparable<T>

Type Parameters

T
Inheritance
RangeValidator<T>
Implements
Inherited Members

Constructors

RangeValidator(T, T, bool)

Creates a new range validator.

public RangeValidator(T min, T max, bool inclusive = true)

Parameters

min T

Minimum value (inclusive).

max T

Maximum value (inclusive).

inclusive bool

If true, min and max are included in the valid range.

Methods

GetErrorMessage(T)

Gets a human-readable error message describing why validation failed.

public string? GetErrorMessage(T value)

Parameters

value T

The invalid value.

Returns

string

An error message, or null if no specific message is available.

IsValid(T)

Validates a value before it is synchronized.

public bool IsValid(T value)

Parameters

value T

The value to validate.

Returns

bool

True if the value is valid, false otherwise.