mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 15:00:06 +00:00
21 lines
471 B
C++
21 lines
471 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);
|
|
|
|
float randFloat(float startInclusive, float endExclusive);
|
|
float randFloat(float endExclusive);
|
|
float randFloat();
|
|
};
|