A tick rate is a collection of tick rates. More...
Classes | |
struct | Resolved |
Represents a resolved tick rate. More... | |
struct | Selection |
Represents a selection of tick rates for client and server. More... | |
Public Types | |
enum class | ValidateResult |
Enumerates the possible results of validating a tick rate selection. More... | |
Public Member Functions | |
Selection | ClampSelection (Selection selection) |
Clamps the indices in the specified Selection to valid ranges. More... | |
int | GetDivisor (int index) |
Gets the divisor for the tick rate at the specified index. More... | |
int | GetTickRate (int index) |
Gets the tick rate at the specified index. More... | |
TickRate (params int[] rates) | |
int[] | ToArray () |
Converts the tick rates to an array. More... | |
bool | Validate () |
Validates the tick rates in the TickRate. More... | |
ValidateResult | ValidateSelection (Selection selected) |
Validates the tick rates in the specified Selection. More... | |
Static Public Member Functions | |
static TickRate | Get (int rate) |
Retrieves the TickRate associated with the specified tick rate. More... | |
static void | Init () |
Initializes the TickRate class by setting up the valid tick rates and their lookup dictionary. More... | |
static void | InitChecked () |
static bool | IsValid (int rate) |
Checks if the provided tick rate is valid. More... | |
static bool | IsValid (TickRate rate) |
Checks if the provided TickRate is valid. More... | |
static Resolved | Resolve (Selection selection) |
Resolves the specified Selection into a Resolved structure. More... | |
Public Attributes | |
int | _count |
fixed int | _rates [4] |
Static Public Attributes | |
static Dictionary< int, TickRate > | _lookup |
static TickRate[] | _valid |
static ReadOnlyCollection< TickRate > | _validReadOnly |
Properties | |
static IReadOnlyList< TickRate > | Available [get] |
Gets a read-only list of all available TickRates. More... | |
int | Client [get] |
Gets the tick rate for the client. More... | |
int | Count [get] |
Gets the count of tick rates in the TickRate. More... | |
int | this[int index] [get] |
Gets the tick rate at the specified index. More... | |
A tick rate is a collection of tick rates.
|
strong |
Enumerates the possible results of validating a tick rate selection.
|
static |
int GetDivisor | ( | int | index | ) |
Gets the divisor for the tick rate at the specified index.
index | The index of the tick rate to get the divisor for. |
ArgumentOutOfRangeException | Thrown when the index is out of range. |
InvalidOperationException | Thrown when the client tick rate is not divisible by the tick rate at the specified index. |
int GetTickRate | ( | int | index | ) |
Gets the tick rate at the specified index.
index | The index of the tick rate to get. |
ArgumentOutOfRangeException | Thrown when the index is out of range. |
|
static |
Initializes the TickRate class by setting up the valid tick rates and their lookup dictionary.
|
static |
Checks if the provided tick rate is valid.
rate | The tick rate to validate. |
|
static |
int [] ToArray | ( | ) |
Converts the tick rates to an array.
bool Validate | ( | ) |
Validates the tick rates in the TickRate.
The tick rates are valid if:
ValidateResult ValidateSelection | ( | Selection | selected | ) |
Validates the tick rates in the specified Selection.
selected | The Selection to validate. |
The Selection is valid if:
|
staticget |
Gets a read-only list of all available TickRates.
This property ensures that the TickRate class is initialized before returning the list.
|
get |
Gets the tick rate for the client.
|
get |
Gets the count of tick rates in the TickRate.
|
get |
Gets the tick rate at the specified index.
index | The index of the tick rate to get. |