styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
StyyxUtil::RandomiserUtil Struct Reference

#include <st-random.h>

Static Public Member Functions

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 Private Member Functions

static std::mt19937 & GetRNG ()

Member Function Documentation

◆ GetRandomDouble()

double StyyxUtil::RandomiserUtil::GetRandomDouble ( const double a_min,
const double a_max )
inlinestatic

Get random double between 2 values.

Parameters
a_minlower value for the random double
a_maxhigher value for the random double
Returns
random double between low and high value
Here is the call graph for this function:

◆ GetRandomFloat()

float StyyxUtil::RandomiserUtil::GetRandomFloat ( const float a_min,
const float a_max )
inlinestatic

Get random float between 2 values.

Parameters
a_minlower value for the random float
a_maxhigher value for the random float
Returns
random float between low and high value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRandomInt()

int StyyxUtil::RandomiserUtil::GetRandomInt ( const int a_min,
const int a_max )
inlinestatic

Get random integer between 2 values.

Parameters
a_minlower value for the random integer
a_maxhigher value for the random integer
Returns
random integer between low and high value
Here is the call graph for this function:

◆ 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_minlower value for the random float
a_maxhigher value for the random float
decimalsamount of decimals the float is rounded to
Returns
random float rounded to the amount of decimals specified
Here is the call graph for this function:

◆ GetRNG()

std::mt19937 & StyyxUtil::RandomiserUtil::GetRNG ( )
inlinestaticprivate
Here is the caller graph for this function:

◆ IsPercentageChanceFloat()

bool StyyxUtil::RandomiserUtil::IsPercentageChanceFloat ( const float a_chancePercent)
inlinestatic

Rolls a random chance check against a given percentage.

Parameters
a_chancePercentThe 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
Here is the call graph for this function:

The documentation for this struct was generated from the following file: