Add RandomValueWithinLimits to IntegerRange

This commit is contained in:
glax 2024-02-12 02:04:58 +01:00
parent 1eed03ac14
commit 4839c12340

View File

@ -16,6 +16,11 @@ public readonly struct IntegerRange
return value >= this.Min && value <= this.Max; return value >= this.Min && value <= this.Max;
} }
public int RandomValueWithinLimits()
{
return Random.Shared.Next(this.Min, this.Max);
}
internal string RangeString() internal string RangeString()
{ {
return $"{this.Min}-{this.Max}"; return $"{this.Min}-{this.Max}";