23 lines
518 B
C++
23 lines
518 B
C++
#pragma once
|
|
|
|
#include <random>
|
|
|
|
namespace VUtils {
|
|
|
|
class Random {
|
|
public:
|
|
static Random& the() {
|
|
static Random _instance;
|
|
return _instance;
|
|
}
|
|
Random();
|
|
static double generate(double min, double max);
|
|
double get(double min, double max);
|
|
void setDist(double min, double max);
|
|
double getFast();
|
|
private:
|
|
std::random_device m_rd;
|
|
std::mt19937 m_mt;
|
|
std::uniform_real_distribution<double> m_dist;
|
|
};
|
|
} |