The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
random_new_deterministic.hpp
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 */
14 #ifndef RANDOM_NEW_DETERMINISTIC_H_INCLUDED
15 #define RANDOM_NEW_DETERMINISTIC_H_INCLUDED
16 #include "random_new.hpp"
17 #include "mt_rng.hpp"
18 
19 namespace random_new
20 {
21  /**
22  This rng is used when the normal synced rng is not available
23  this is currently only he case at the very start of the scenario (random generation of starting units traits).
24 
25  or during the "Deterministic SP mode"
26  */
28  {
29  public:
31  virtual ~rng_deterministic();
32 
33  protected:
34  virtual uint32_t next_random_impl();
35  private:
37  };
38 
39  /**
40  RAII class to use rng_deterministic in the current scope.
41  */
43  {
44  public:
47  private :
48  rng* old_rng_;
50  };
51 }
52 
53 #endif
boost::uint32_t uint32_t
Definition: xbrz.hpp:45
RAII class to use rng_deterministic in the current scope.
This rng is used when the normal synced rng is not available this is currently only he case at the ve...
this class does not give synced random results derived classes might do.
Definition: random_new.hpp:27