CreatureLib/src/Core/Random.hpp
Deukhoofd a8730d983f
All checks were successful
continuous-integration/drone/push Build is passing
Used ClangFormat style guide I'm happy with.
2019-11-28 12:55:22 +01:00

25 lines
592 B
C++

#ifndef CREATURELIB_RANDOM_HPP
#define CREATURELIB_RANDOM_HPP
#include <chrono>
#include <cstdint>
#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