mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
23 lines
499 B
C++
23 lines
499 B
C++
#pragma once
|
|
|
|
#include <random>
|
|
#include <memory>
|
|
|
|
namespace Rand {
|
|
extern std::unique_ptr<std::mt19937> generator;
|
|
|
|
void init(uint64_t seed);
|
|
|
|
int32_t rand(int32_t startInclusive, int32_t endExclusive);
|
|
int32_t rand(int32_t endExclusive);
|
|
int32_t rand();
|
|
|
|
int32_t randWeighted(const std::vector<int32_t>& weights);
|
|
|
|
uint64_t cryptoRand();
|
|
|
|
float randFloat(float startInclusive, float endExclusive);
|
|
float randFloat(float endExclusive);
|
|
float randFloat();
|
|
};
|