mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-29 09:40:08 +00:00
added better drop handling, parsing, rng
This commit is contained in:
committed by
Gent Semaj
parent
aa028392f0
commit
78b17aea72
20
src/Rand.hpp
Normal file
20
src/Rand.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <random>
|
||||
#include <memory>
|
||||
|
||||
namespace Rand {
|
||||
extern std::unique_ptr<std::mt19937> generator;
|
||||
|
||||
void init();
|
||||
|
||||
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();
|
||||
};
|
||||
Reference in New Issue
Block a user