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
TThe type of the config item's value.
TQuantityThe 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
defaultConfigurationUnitConfigurationThe default unit configuration for this config item's value.
imperialConfigurationUnitConfigurationThe imperial unit configuration for this config item's value.
minTThe lower bound of the value range.
maxTThe upper bound of the value range.
comparerIComparer<T>The comparer to use to determine whether values fall into the range of this config item.
Exceptions
- ArgumentNullException
When
minormaxare null.- NotSupportedException
When
compareris null whileTis 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; }