mirror of
https://github.com/gwm17/Mask.git
synced 2025-10-02 12:48:49 -04:00
27 lines
384 B
C++
27 lines
384 B
C++
#ifndef RANDOMGENERATOR_H
|
|
#define RANDOMGENERATOR_H
|
|
|
|
#include <random>
|
|
|
|
namespace Mask {
|
|
|
|
class RandomGenerator
|
|
{
|
|
public:
|
|
~RandomGenerator();
|
|
std::mt19937& GetGenerator() { return rng; }
|
|
static RandomGenerator& GetInstance()
|
|
{
|
|
static thread_local RandomGenerator s_instance;
|
|
return s_instance;
|
|
}
|
|
|
|
private:
|
|
RandomGenerator();
|
|
|
|
std::mt19937 rng;
|
|
};
|
|
|
|
}
|
|
|
|
#endif |