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
UnitConfigurationThe default unit configuration for this config item's value.
imperialConfiguration
UnitConfigurationThe imperial unit configuration for this config item's value.
min
TThe lower bound of the value range.
max
TThe 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
ormax
are null.- NotSupportedException
When
comparer
is null whileT
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 notnull
; 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; }