The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
random_new_deterministic.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
15 
16 
17 namespace random_new
18 {
19 
21  : generator_(gen)
22  {
23 
24  }
25 
27  {
28 
29  }
30 
32  {
33  return generator_.get_next_random();
34  }
35 
36 
38  : old_rng_(generator), new_rng_(rng)
39  {
41  }
42 
44  {
46  }
47 }
rng * generator
This generator is automatically synced during synced context.
Definition: random_new.cpp:52
boost::uint32_t uint32_t
Definition: xbrz.hpp:45
uint32_t get_next_random()
Get a new random number.
Definition: mt_rng.cpp:63
this class does not give synced random results derived classes might do.
Definition: random_new.hpp:27