The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
random_new::rng_deterministic Class Reference

This rng is used when the normal synced rng is not available this is currently only he case at the very start of the scenario (random generation of starting units traits). More...

#include <random_new_deterministic.hpp>

Inheritance diagram for random_new::rng_deterministic:
Inheritance graph

Public Member Functions

 rng_deterministic (rand_rng::mt_rng &gen)
 
virtual ~rng_deterministic ()
 
- Public Member Functions inherited from random_new::rng
 rng ()
 
uint32_t next_random ()
 Provides the next random draw. More...
 
virtual ~rng ()
 
unsigned int get_random_calls ()
 Provides the number of random calls to the rng in this context. More...
 
int get_random_int (int min, int max)
 
This helper method provides a random int from the underlying generator,

using results of next_random in a manner guaranteed to be cross platform. More...

 

Protected Member Functions

virtual uint32_t next_random_impl ()
 

Private Attributes

rand_rng::mt_rnggenerator_
 

Additional Inherited Members

- Static Public Member Functions inherited from random_new::rng
static rngdefault_instance ()
 
- Protected Attributes inherited from random_new::rng
unsigned int random_calls_
 

Detailed Description

This rng is used when the normal synced rng is not available this is currently only he case at the very start of the scenario (random generation of starting units traits).

or during the "Deterministic SP mode"

Definition at line 27 of file random_new_deterministic.hpp.

Constructor & Destructor Documentation

random_new::rng_deterministic::rng_deterministic ( rand_rng::mt_rng gen)

Definition at line 20 of file random_new_deterministic.cpp.

random_new::rng_deterministic::~rng_deterministic ( )
virtual

Definition at line 26 of file random_new_deterministic.cpp.

Member Function Documentation

uint32_t random_new::rng_deterministic::next_random_impl ( )
protectedvirtual

Implements random_new::rng.

Definition at line 31 of file random_new_deterministic.cpp.

References generator_, and rand_rng::mt_rng::get_next_random().

Member Data Documentation

rand_rng::mt_rng& random_new::rng_deterministic::generator_
private

Definition at line 36 of file random_new_deterministic.hpp.

Referenced by next_random_impl().


The documentation for this class was generated from the following files: