24 lines
590 B
C++
24 lines
590 B
C++
#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
|