The Battle for Wesnoth  1.19.5+dev
random_deterministic.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
3  by David White <dave@whitevine.net>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #include "random_deterministic.hpp"
17 
18 
19 namespace randomness
20 {
21 
23  : generator_(gen)
24  {
25 
26  }
27 
29  {
30 
31  }
32 
34  {
35  return generator_.get_next_random();
36  }
37 
38 
40  : old_rng_(generator), new_rng_(rng)
41  {
43  }
44 
46  {
48  }
49 }
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.hpp:28
rng * generator
This generator is automatically synced during synced context.
Definition: random.cpp:60