27 class rng :
private std::numeric_limits<uint32_t>
29 using base = std::numeric_limits<uint32_t>;
110 template <
typename T>
117 while (sum <= target)
129 return std::distance(first, it);
this class does not give synced random results derived classes might do.
unsigned int get_random_calls() const
Provides the number of random calls to the rng in this context.
uint32_t next_random()
Provides the next random draw.
static rng & default_instance()
std::numeric_limits< uint32_t > base
T::difference_type get_random_element(T first, T last)
This helper method selects a random element from a container of floating-point numbers.
virtual uint32_t next_random_impl()=0
unsigned int random_calls_
virtual bool is_networked() const
Is this random source networked? If it is it's very important we do actually use this random source t...
int get_random_int(int min, int max)
bool get_random_bool(double probability)
This helper method returns true with the probability supplied as a parameter.
double get_random_double()
This helper method returns a floating-point number in the range [0,1[.
int get_random_int_in_range_zero_to(int max)
Does the hard work of get_random_int.
rng * generator
This generator is automatically synced during synced context.