Add RandomValueWithinLimits to IntegerRange
This commit is contained in:
parent
1eed03ac14
commit
4839c12340
@ -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}";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user