SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
Random.h
1#pragma once
2
3#include "spark/lib/Export.h"
4
5#include <random>
6
7namespace spark::lib
8{
12 class SPARK_LIB_EXPORT Random final
13 {
14 public:
15 template <typename T> requires std::is_floating_point_v<T>
16 static T Number(T min, T max);
17
18 template <typename C> requires std::ranges::range<C>
19 static typename C::value_type ElementInRange(const C& range);
20
21 private:
22 static std::random_device s_randomDevice;
23 static std::mt19937 s_generator;
24 };
25}
26
27#include "spark/lib/impl/Random.h"
A class that provides random generation.
Definition Random.h:13