Show / Hide Table of Contents

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
System.Object
MinRandom
Implements
Troschuetz.Random.IGenerator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GoRogue.Random
Assembly: GoRogue.dll
Syntax
public class MinRandom : IGenerator

Properties

| Improve this Doc View Source

CanReset

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
| Improve this Doc View Source

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 Source

Next()

Returns 0.0

Declaration
public int Next()
Returns
Type Description
System.Int32

0.0

| Improve this Doc View Source

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

| Improve this Doc View Source

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

minValue

| Improve this Doc View Source

NextBoolean()

Returns false.

Declaration
public bool NextBoolean()
Returns
Type Description
System.Boolean

false

| Improve this Doc View Source

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.

| Improve this Doc View Source

NextDouble()

Returns 0.0.

Declaration
public double NextDouble()
Returns
Type Description
System.Double

0.0

| Improve this Doc View Source

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

| Improve this Doc View Source

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

minValue

| Improve this Doc View Source

NextInclusiveMaxValue()

Returns 0.

Declaration
public int NextInclusiveMaxValue()
Returns
Type Description
System.Int32

0

| Improve this Doc View Source

NextUInt()

Returns 0.

Declaration
public uint NextUInt()
Returns
Type Description
System.UInt32

0

| Improve this Doc View Source

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

| Improve this Doc View Source

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

minValue

| Improve this Doc View Source

NextUIntExclusiveMaxValue()

Returns 0.

Declaration
public uint NextUIntExclusiveMaxValue()
Returns
Type Description
System.UInt32

0

| Improve this Doc View Source

NextUIntInclusiveMaxValue()

Returns 0.

Declaration
public uint NextUIntInclusiveMaxValue()
Returns
Type Description
System.UInt32

0

| Improve this Doc View Source

Reset()

Simply returns true, since this generator has no state.

Declaration
public bool Reset()
Returns
Type Description
System.Boolean

true

| Improve this Doc View Source

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

Implements

Troschuetz.Random.IGenerator

Extension Methods

Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX