#include <st-random.h>
|
| static int | GetRandomInt (const int a_min, const int a_max) |
| | Get random integer between 2 values.
|
| static float | GetRandomFloat (const float a_min, const float a_max) |
| | Get random float between 2 values.
|
| static float | GetRandomRoundedFloat (const float a_min, const float a_max, const int decimals=2) |
| | Get random float rounded to a set amount of decimals.
|
| static double | GetRandomDouble (const double a_min, const double a_max) |
| | Get random double between 2 values.
|
| static bool | IsPercentageChanceFloat (const float a_chancePercent) |
| | Rolls a random chance check against a given percentage.
|
|
| static std::mt19937 & | GetRNG () |
◆ GetRandomDouble()
| double StyyxUtil::RandomiserUtil::GetRandomDouble |
( |
const double | a_min, |
|
|
const double | a_max ) |
|
inlinestatic |
Get random double between 2 values.
- Parameters
-
| a_min | lower value for the random double |
| a_max | higher value for the random double |
- Returns
- random double between low and high value
◆ GetRandomFloat()
| float StyyxUtil::RandomiserUtil::GetRandomFloat |
( |
const float | a_min, |
|
|
const float | a_max ) |
|
inlinestatic |
Get random float between 2 values.
- Parameters
-
| a_min | lower value for the random float |
| a_max | higher value for the random float |
- Returns
- random float between low and high value
◆ GetRandomInt()
| int StyyxUtil::RandomiserUtil::GetRandomInt |
( |
const int | a_min, |
|
|
const int | a_max ) |
|
inlinestatic |
Get random integer between 2 values.
- Parameters
-
| a_min | lower value for the random integer |
| a_max | higher value for the random integer |
- Returns
- random integer between low and high value
◆ GetRandomRoundedFloat()
| float StyyxUtil::RandomiserUtil::GetRandomRoundedFloat |
( |
const float | a_min, |
|
|
const float | a_max, |
|
|
const int | decimals = 2 ) |
|
inlinestatic |
Get random float rounded to a set amount of decimals.
- Parameters
-
| a_min | lower value for the random float |
| a_max | higher value for the random float |
| decimals | amount of decimals the float is rounded to |
- Returns
- random float rounded to the amount of decimals specified
◆ GetRNG()
| std::mt19937 & StyyxUtil::RandomiserUtil::GetRNG |
( |
| ) |
|
|
inlinestaticprivate |
◆ IsPercentageChanceFloat()
| bool StyyxUtil::RandomiserUtil::IsPercentageChanceFloat |
( |
const float | a_chancePercent | ) |
|
|
inlinestatic |
Rolls a random chance check against a given percentage.
- Parameters
-
| a_chancePercent | The success threshold (0-100). A value of 30.0 means a 30% chance of returning true |
- Returns
- true if the random roll succeeds, false otherwise
The documentation for this struct was generated from the following file: