Initial commit

This commit is contained in:
2019-10-06 13:50:52 +02:00
commit 265923231f
44 changed files with 16258 additions and 0 deletions

23
src/Core/Random.hpp Normal file
View 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