The Battle for Wesnoth  1.19.0-dev
random_deterministic.hpp
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 #pragma once
17 
18 #include "random.hpp"
19 #include "mt_rng.hpp"
20 
21 namespace randomness
22 {
23  /**
24  This rng is used when the normal synced rng is not available
25  this is currently only he case at the very start of the scenario (random generation of starting units traits).
26 
27  or during the "Deterministic SP mode"
28  */
30  {
31  public:
33  virtual ~rng_deterministic();
34 
35  protected:
36  virtual uint32_t next_random_impl();
37  private:
39  };
40 
41  /**
42  RAII class to use rng_deterministic in the current scope.
43  */
45  {
46  public:
49  private :
52  };
53 }
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.hpp:28
RAII class to use rng_deterministic in the current scope.