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