The Battle for Wesnoth  1.15.1+dev
random_deterministic.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2018 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project https://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 */
14 #include "random_deterministic.hpp"
15 
16 
17 namespace randomness
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 }
uint32_t get_next_random()
Get a new random number.
Definition: mt_rng.cpp:62
rng * generator
This generator is automatically synced during synced context.
Definition: random.cpp:60
this class does not give synced random results derived classes might do.
Definition: random.hpp:27