2017-12-30 00:08:09 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <random>
|
|
|
|
|
|
|
|
class Rng {
|
|
|
|
unsigned int seed = 0;
|
|
|
|
unsigned int step = 0;
|
|
|
|
std::mt19937 mte;
|
|
|
|
public:
|
2017-12-30 20:15:39 +01:00
|
|
|
static unsigned int get_random_seed();
|
|
|
|
|
2017-12-30 00:08:09 +01:00
|
|
|
Rng();
|
|
|
|
Rng(unsigned int seed, unsigned int step = 0);
|
|
|
|
~Rng();
|
|
|
|
|
2017-12-30 20:15:39 +01:00
|
|
|
int get_int(int max = 100);
|
2017-12-30 00:08:09 +01:00
|
|
|
int get_int(int min, int max);
|
2017-12-30 20:15:39 +01:00
|
|
|
float get_float(float max = 1);
|
|
|
|
float get_float(float min, float max);
|
2017-12-30 00:08:09 +01:00
|
|
|
};
|
|
|
|
|