blob: 56fbbf187b770b0e6d8e34e758b7c83d05e74d08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include "generator.hpp"
RandomNumberGenerator::RandomNumberGenerator(const uint32_t &seed)
{
this->_generator = std::make_unique<std::mt19937>(seed);
}
uint32_t RandomNumberGenerator::in_range(const uint32_t &a, const uint32_t &b) const
{
auto random_distribution = std::uniform_int_distribution<uint32_t>(a, b);
return random_distribution(*this->_generator);
}
|