Class MinRandom
A "random" number generator that always returns the minValue parameter given, or 0 on the Next overload that only takes maxValue. Again, may be useful for testing. Also used in DiceExpression for certain minimum roll functions.
Inheritance
Implements
Inherited Members
Namespace: GoRogue.Random
Assembly: GoRogue.dll
Syntax
public class MinRandom : IGenerator
Properties
| Improve this Doc View SourceCanReset
Whether or not the RNG is capable of resetting, such that it will return the same series of values again.
Declaration
public bool CanReset { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Seed
Since this RNG returns the maximum possible value, this field will always return 0.
Declaration
public uint Seed { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Methods
| Improve this Doc View SourceNext()
Returns 0.0
Declaration
public int Next()
Returns
Type | Description |
---|---|
System.Int32 | 0.0 |
Next(Int32)
Returns 0.0
Declaration
public int Next(int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxValue |
Returns
Type | Description |
---|---|
System.Int32 | 0.0 |
Next(Int32, Int32)
Returns minValue
.
Declaration
public int Next(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minValue | The minimum value for the returned number (which is always returned by this generator) |
System.Int32 | maxValue | The maximum value for the returned number (which is unused since this generator always returns the minimum. |
Returns
Type | Description |
---|---|
System.Int32 |
|
NextBoolean()
Returns false.
Declaration
public bool NextBoolean()
Returns
Type | Description |
---|---|
System.Boolean | false |
NextBytes(Byte[])
Fills the given buffer with bytes of value 0.
Declaration
public void NextBytes(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer to fill. |
NextDouble()
Returns 0.0.
Declaration
public double NextDouble()
Returns
Type | Description |
---|---|
System.Double | 0.0 |
NextDouble(Double)
Returns 0.0.
Declaration
public double NextDouble(double maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | maxValue | The maximum value for the returned number, exclusive. Unused since this function always returns the minimum. |
Returns
Type | Description |
---|---|
System.Double | 0.0 |
NextDouble(Double, Double)
Returns minValue
.
Declaration
public double NextDouble(double minValue, double maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | minValue | The minimum value for the returned number (always returned since this function always returns the minimum). |
System.Double | maxValue | The maximum vlaue for the returned number (unused). |
Returns
Type | Description |
---|---|
System.Double |
|
NextInclusiveMaxValue()
Returns 0.
Declaration
public int NextInclusiveMaxValue()
Returns
Type | Description |
---|---|
System.Int32 | 0 |
NextUInt()
Returns 0.
Declaration
public uint NextUInt()
Returns
Type | Description |
---|---|
System.UInt32 | 0 |
NextUInt(UInt32)
Returns 0.
Declaration
public uint NextUInt(uint maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | maxValue | The maximum value for the returned number (unused since this generator always returns the minimum). |
Returns
Type | Description |
---|---|
System.UInt32 | 0 |
NextUInt(UInt32, UInt32)
Returns minValue
.
Declaration
public uint NextUInt(uint minValue, uint maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | minValue | The minimum value for the returned number (this generator always returns the minimum value). |
System.UInt32 | maxValue | The maximum value for the returned number (unused). |
Returns
Type | Description |
---|---|
System.UInt32 |
|
NextUIntExclusiveMaxValue()
Returns 0.
Declaration
public uint NextUIntExclusiveMaxValue()
Returns
Type | Description |
---|---|
System.UInt32 | 0 |
NextUIntInclusiveMaxValue()
Returns 0.
Declaration
public uint NextUIntInclusiveMaxValue()
Returns
Type | Description |
---|---|
System.UInt32 | 0 |
Reset()
Simply returns true, since this generator has no state.
Declaration
public bool Reset()
Returns
Type | Description |
---|---|
System.Boolean | true |
Reset(UInt32)
Simply returns true, since this generator has no state.
Declaration
public bool Reset(uint seed)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | seed | Unused, since this generator has no seed. |
Returns
Type | Description |
---|---|
System.Boolean | true |