Table of Contents

Class ConfigKeyQuantity<T, TQuantity>

Namespace
MonkeyLoader.Resonite.Configuration
Assembly
MonkeyLoader.Resonite.Integration.dll

Represents the typed definition for a quantified config item.

public class ConfigKeyQuantity<T, TQuantity> : ConfigKeyRange<T>, IConfigKeyValidator<T>, IConfigKeyQuantity<T>, IConfigKeyRange<T>, IConfigKeyComponent<IDefiningConfigKey<T>>, IComponent<IDefiningConfigKey<T>> where TQuantity : unmanaged, IQuantity<TQuantity>

Type Parameters

T

The type of the config item's value.

TQuantity

The type of the config item's value's quantity.

Inheritance
ConfigKeyQuantity<T, TQuantity>
Implements
Inherited Members

Constructors

ConfigKeyQuantity(UnitConfiguration, UnitConfiguration?, T?, T?, IComparer<T?>?)

Creates a new instance of the ConfigKeyQuantity<T, TQuantity> component with the given unit and parameters.

public ConfigKeyQuantity(UnitConfiguration defaultConfiguration, UnitConfiguration? imperialConfiguration = null, T? min = default, T? max = default, IComparer<T?>? comparer = null)

Parameters

defaultConfiguration UnitConfiguration

The default unit configuration for this config item's value.

imperialConfiguration UnitConfiguration

The imperial unit configuration for this config item's value.

min T

The lower bound of the value range.

max T

The upper bound of the value range.

comparer IComparer<T>

The comparer to use to determine whether values fall into the range of this config item.

Exceptions

ArgumentNullException

When min or max are null.

NotSupportedException

When comparer is null while T is not IComparable<T>

Properties

DefaultConfiguration

Gets the default unit configuration for this config item's value.

public UnitConfiguration DefaultConfiguration { get; }

Property Value

UnitConfiguration

HasImperialConfiguration

Gets whether this config item's value has an imperial configuration.

public bool HasImperialConfiguration { get; }

Property Value

bool

true, if ImperialConfiguration is not null; otherwise, false.

ImperialConfiguration

Gets the imperial unit configuration for this config item's value.

public UnitConfiguration? ImperialConfiguration { get; }

Property Value

UnitConfiguration

QuantityType

Gets the Type of this config item's value's quantity.

public Type QuantityType { get; }

Property Value

Type