27 QSharedPointer<std::mt19937> Random::generator = QSharedPointer<std::mt19937>();
29 void Random::builtInInit()
31 if (Random::generator.isNull())
33 std::random_device randomDevice;
34 init(randomDevice() + QDateTime::currentDateTime().toMSecsSinceEpoch());
40 Random::generator.reset(
new std::mt19937(seed));
46 return (*Random::generator.data())() % max;
static unsigned short nextUShort(unsigned short max)
Generates a new random unsigned short.
static void init(int seed)
Inits or re-inits the Random class with specified seed.