#include <rng.hpp>


Public Member Functions | |
| rng () | |
| int | get_random () |
| Get the next random number -- from the results if available, from the generator otherwise. | |
| int | get_random_nocheck () |
| Get the next random number. | |
| const config * | get_random_results () |
| void | set_random_results (const config &cfg) |
| void | set_seed (int seed) |
Protected Member Functions | |
| int | get_random_private (bool check) |
| config * | random () |
| void | set_random (config *) |
Private Attributes | |
| config * | random_ |
| size_t | random_child_ |
| simple_rng | generator_ |
Definition at line 29 of file rng.hpp.
| rand_rng::rng::rng | ( | ) |
Definition at line 151 of file random.cpp.
| int rand_rng::rng::get_random | ( | ) |
Get the next random number -- from the results if available, from the generator otherwise.
The two should match.
Definition at line 155 of file random.cpp.
References get_random_private().

| int rand_rng::rng::get_random_nocheck | ( | ) |
Get the next random number.
Do not check if the random number is consistent with local seed state (evantually this should be never used).
Definition at line 160 of file random.cpp.
References get_random_private().

| int rand_rng::rng::get_random_private | ( | bool | check | ) | [protected] |
Definition at line 165 of file random.cpp.
References config::add_child(), config::child(), config::child_count(), ERR_RND, generator_, rand_rng::simple_rng::get_next_random(), LOG_RND, random_, and random_child_.
Referenced by get_random(), and get_random_nocheck().


| const config * rand_rng::rng::get_random_results | ( | ) |
Definition at line 196 of file random.cpp.
References config::child(), config::child_count(), random_, and random_child_.

| config * rand_rng::rng::random | ( | ) | [protected] |
Definition at line 215 of file random.cpp.
References random_.
Referenced by replay::add_seed().

| void rand_rng::rng::set_random | ( | config * | random | ) | [protected] |
Definition at line 220 of file random.cpp.
References random_, and random_child_.
Referenced by replay::add_command(), replay::clear(), replay::get_next_action(), replay::pre_replay(), replay::set_to_end(), and replay::undo().

| void rand_rng::rng::set_random_results | ( | const config & | cfg | ) |
Definition at line 205 of file random.cpp.
References config::add_child(), config::child(), config::child_count(), config::clear_children(), random_, and random_child_.

| void rand_rng::rng::set_seed | ( | int | seed | ) |
Definition at line 227 of file random.cpp.
References generator_, LOG_RND, and rand_rng::simple_rng::seed_random().
Referenced by do_gameloop().


simple_rng rand_rng::rng::generator_ [private] |
Definition at line 60 of file rng.hpp.
Referenced by get_random_private(), and set_seed().
config* rand_rng::rng::random_ [private] |
Definition at line 57 of file rng.hpp.
Referenced by get_random_private(), get_random_results(), random(), set_random(), and set_random_results().
size_t rand_rng::rng::random_child_ [private] |
Definition at line 58 of file rng.hpp.
Referenced by get_random_private(), get_random_results(), set_random(), and set_random_results().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:25:27 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |