Initial commit
This commit is contained in:
23
src/Core/Random.hpp
Normal file
23
src/Core/Random.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef CREATURELIB_RANDOM_HPP
|
||||
#define CREATURELIB_RANDOM_HPP
|
||||
#include <cstdint>
|
||||
#include <chrono>
|
||||
#include <random>
|
||||
using namespace std::chrono;
|
||||
namespace CreatureLib::Core {
|
||||
class Random {
|
||||
private:
|
||||
std::mt19937 _rng;
|
||||
public:
|
||||
Random();
|
||||
explicit Random(int32_t seed) : _rng(seed){};
|
||||
|
||||
[[nodiscard]] float GetFloat();
|
||||
[[nodiscard]] double GetDouble();
|
||||
[[nodiscard]] int32_t Get();
|
||||
[[nodiscard]] int32_t Get(int32_t max);
|
||||
[[nodiscard]] int32_t Get(int32_t min, int32_t max);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_RANDOM_HPP
|
||||
Reference in New Issue
Block a user