2024-02-04 17:47:36 +01:00
|
|
|
|
namespace CShocker.Ranges;
|
|
|
|
|
|
|
|
|
|
public readonly struct IntegerRange
|
|
|
|
|
{
|
|
|
|
|
public readonly int Min, Max;
|
|
|
|
|
|
|
|
|
|
public IntegerRange(int min, int max)
|
|
|
|
|
{
|
|
|
|
|
this.Min = min;
|
|
|
|
|
this.Max = max;
|
|
|
|
|
}
|
2024-02-11 22:24:53 +01:00
|
|
|
|
|
|
|
|
|
public bool ValueWithinLimits(int value)
|
|
|
|
|
{
|
|
|
|
|
return value >= this.Min && value <= this.Max;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal string RangeString()
|
|
|
|
|
{
|
|
|
|
|
return $"{this.Min}-{this.Max}";
|
|
|
|
|
}
|
2024-02-04 17:47:36 +01:00
|
|
|
|
}
|