The Battle for Wesnoth  1.19.5+dev
generate_map.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2024
3  by Mark de Wever <koraq@xs4all.nl>
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 
19 #include "utils/optional_fwd.hpp"
20 
21 #include <cstdint>
22 #include <memory>
23 
24 class map_generator;
25 
26 namespace gui2
27 {
28 
29 namespace dialogs
30 {
31 
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  utils::optional<uint32_t> get_seed();
47 
48 private:
49  virtual const std::string& window_id() const override;
50 
51  virtual void pre_show() override;
52 
53  /** Callback for generator list selection changes. */
54  void do_generator_selected();
55 
56  /** Callback for the generator settings button. */
57  void do_settings();
58 
59  /** Available map generators */
60  std::vector<std::unique_ptr<map_generator>>& map_generators_;
61 
62  /** Last used map generator, must be in map_generators_ */
64 
65  /** Current map generator index */
67 
68  /** random seed integer input*/
69  std::string random_seed_;
70 };
71 
72 } // namespace dialogs
73 } // namespace gui2
virtual void pre_show() override
Actions to be taken before showing the window.
std::vector< std::unique_ptr< map_generator > > & map_generators_
Available map generators.
int current_map_generator_
Current map generator index.
utils::optional< uint32_t > get_seed()
editor_generate_map(std::vector< std::unique_ptr< map_generator >> &mg)
void do_generator_selected()
Callback for generator list selection changes.
void do_settings()
Callback for the generator settings button.
std::vector< std::unique_ptr< map_generator > > & get_map_generators()
map_generator * last_map_generator_
Last used map generator, must be in map_generators_.
virtual const std::string & window_id() const override
The ID of the window to build.
std::string random_seed_
random seed integer input
void select_map_generator(map_generator *mg)
map_generator * get_selected_map_generator()
Abstract base class for all modal dialogs.
Various uncategorised dialogs.
Generic file dialog.