13 std::uniform_int_distribution<int> distrib(a_min, a_max);
23 std::uniform_real_distribution<float> distrib(a_min, a_max);
35 const double factor = std::pow(10.0,
static_cast<double>(decimals));
36 return static_cast<float>(std::round(value * factor) / factor);
44 std::uniform_real_distribution<double> distrib(a_min, a_max);
57 static std::mt19937 gen(std::random_device{}());
static int GetRandomInt(const int a_min, const int a_max)
Get random integer between 2 values.
Definition st-random.h:11
static std::mt19937 & GetRNG()
Definition st-random.h:55
static double GetRandomDouble(const double a_min, const double a_max)
Get random double between 2 values.
Definition st-random.h:43
static bool IsPercentageChanceFloat(const float a_chancePercent)
Rolls a random chance check against a given percentage.
Definition st-random.h:51
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.
Definition st-random.h:32
static float GetRandomFloat(const float a_min, const float a_max)
Get random float between 2 values.
Definition st-random.h:21