The Battle for Wesnoth  1.15.1+dev
generate_map.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2018 by Mark de Wever <koraq@xs4all.nl>
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 
15 #pragma once
16 
18 
19 #include <boost/optional/optional.hpp>
20 #include <cstdint>
21 #include <memory>
22 
23 class map_generator;
24 
25 namespace gui2
26 {
27 
28 namespace dialogs
29 {
30 
31 /** The dialog for selecting which random generator to use in the editor. */
33 {
34 public:
35  explicit editor_generate_map(std::vector<std::unique_ptr<map_generator>>& mg);
36 
37  std::vector<std::unique_ptr<map_generator>>& get_map_generators()
38  {
39  return map_generators_;
40  }
41 
43 
45 
46  boost::optional<uint32_t> get_seed();
47 
48 private:
49  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
50  virtual const std::string& window_id() const override;
51 
52  /** Inherited from modal_dialog. */
53  virtual void pre_show(window& window) override;
54 
55  /** Callback for generator list selection changes. */
56  void do_generator_selected(window& window);
57 
58  /** Callback for the generator settings button. */
59  void do_settings();
60 
61  /** Available map generators */
62  std::vector<std::unique_ptr<map_generator>>& map_generators_;
63 
64  /** Last used map generator, must be in map_generators_ */
66 
67  /** Current map generator index */
69 
70  /** random seed integer input*/
71  std::string random_seed_;
72 };
73 
74 } // namespace dialogs
75 } // namespace gui2
int current_map_generator_
Current map generator index.
boost::optional< uint32_t > get_seed()
void do_settings()
Callback for the generator settings button.
editor_generate_map(std::vector< std::unique_ptr< map_generator >> &mg)
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
std::vector< std::unique_ptr< map_generator > > & get_map_generators()
map_generator * get_selected_map_generator()
Generic file dialog.
Definition: field-fwd.hpp:22
map_generator * last_map_generator_
Last used map generator, must be in map_generators_.
void select_map_generator(map_generator *mg)
std::vector< std::unique_ptr< map_generator > > & map_generators_
Available map generators.
Various uncategorised dialogs.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Abstract base class for all modal dialogs.
void do_generator_selected(window &window)
Callback for generator list selection changes.
std::string random_seed_
random seed integer input
The dialog for selecting which random generator to use in the editor.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:63