The Battle for Wesnoth  1.19.7+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::dialogs
27 {
29 {
30 public:
31  explicit editor_generate_map(std::vector<std::unique_ptr<map_generator>>& mg);
32 
33  std::vector<std::unique_ptr<map_generator>>& get_map_generators()
34  {
35  return map_generators_;
36  }
37 
39 
41 
42  utils::optional<uint32_t> get_seed();
43 
44 private:
45  virtual const std::string& window_id() const override;
46 
47  virtual void pre_show() override;
48 
49  /** Callback for generator list selection changes. */
50  void do_generator_selected();
51 
52  /** Callback for the generator settings button. */
53  void do_settings();
54 
55  /** Available map generators */
56  std::vector<std::unique_ptr<map_generator>>& map_generators_;
57 
58  /** Last used map generator, must be in map_generators_ */
60 
61  /** Current map generator index */
63 
64  /** random seed integer input*/
65  std::string random_seed_;
66 };
67 
68 } // namespace gui2::dialogs
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.