You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
443 B

3 years ago
#include "Random.h"
INT RndGetRandomInt(INT min, INT max)
{
std::random_device rd;
std::default_random_engine generator(rd());
3 years ago
std::uniform_int_distribution<UINT> distribution(min, max);
3 years ago
return distribution(generator);
}
FLOAT RndGetRandomFloat(FLOAT min, FLOAT max)
{
std::random_device Random;
std::mt19937 RandomGenerator(Random());
std::uniform_real<FLOAT> RandomDistribute(min, max);
return RandomDistribute(RandomGenerator);
}