public Range Min/Max
This commit is contained in:
parent
f469cb5a04
commit
e6ca0a3823
@ -7,7 +7,7 @@
|
|||||||
<Authors>Glax</Authors>
|
<Authors>Glax</Authors>
|
||||||
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<Version>1.1.4</Version>
|
<Version>1.1.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
public abstract class RandomIntegerRange
|
public abstract class RandomIntegerRange
|
||||||
{
|
{
|
||||||
public Range _range { get; init; }
|
public Range Range { get; init; }
|
||||||
internal RandomIntegerRange(Range range, Range limits)
|
internal RandomIntegerRange(Range range, Range limits)
|
||||||
{
|
{
|
||||||
if (range.Max - range.Min < 0)
|
if (range.Max - range.Min < 0)
|
||||||
@ -11,11 +11,11 @@ public abstract class RandomIntegerRange
|
|||||||
throw new ArgumentOutOfRangeException(nameof(limits.Min), "Min has to be withing Range 0-100");
|
throw new ArgumentOutOfRangeException(nameof(limits.Min), "Min has to be withing Range 0-100");
|
||||||
if (range.Max < limits.Min || range.Max > limits.Max)
|
if (range.Max < limits.Min || range.Max > limits.Max)
|
||||||
throw new ArgumentOutOfRangeException(nameof(range.Max), "Max has to be withing Range 0-100");
|
throw new ArgumentOutOfRangeException(nameof(range.Max), "Max has to be withing Range 0-100");
|
||||||
this._range = range;
|
this.Range = range;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRandomRangeValue()
|
public int GetRandomRangeValue()
|
||||||
{
|
{
|
||||||
return Random.Shared.Next(_range.Min, _range.Max);
|
return Random.Shared.Next(Range.Min, Range.Max);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user