Class RandomInt
Data class used to get random int values from a given [min,max] interval
Inherited Members
Namespace: Doozy.Runtime.Common
Assembly: cs.temp.dll.dll
Syntax
public class RandomInt
Constructors
RandomInt()
Construct a new RandomInt with the default [min, max] interval of [0,1]
Declaration
public RandomInt()
RandomInt(RandomInt)
Construct a new RandomInt using the [min,max] interval values from the other RandomInt
Declaration
public RandomInt(RandomInt other)
Parameters
Type | Name | Description |
---|---|---|
RandomInt | other | Other RandomInt |
RandomInt(Int32, Int32)
Construct a new RandomInt with the given min and max interval values
Declaration
public RandomInt(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minValue | Min value |
Int32 | maxValue | Max value |
Properties
currentValue
Current random value from the [MIN,MAX] interval
Value updated every time 'randomValue' is used
Declaration
public int currentValue { get; }
Property Value
Type | Description |
---|---|
Int32 |
max
Declaration
public int max { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
min
Declaration
public int min { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
previousValue
Previous random value
Used to make sure no two consecutive random values are used
Declaration
public int previousValue { get; }
Property Value
Type | Description |
---|---|
Int32 |
randomValue
Random number between MIN [inclusive] and MAX [inclusive] (Read Only)
Updates both the currentValue and the previousValue
Declaration
public int randomValue { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Reset(Int32, Int32)
Reset the interval to the given min and max values
Declaration
public void Reset(int minValue = 0, int maxValue = 1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minValue | Min value |
Int32 | maxValue | Max value |