The Battle for Wesnoth  1.19.5+dev
default_map_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 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 "config.hpp"
20 
22  generator_data(const config& cfg);
23  generator_data() = default;
24 
25  int width;
26  int height;
29  int nplayers;
30  int nvillages;
32  int hill_size;
36  int max_lakes;
39 };
40 
42 {
43 public:
45 
46  bool allow_user_config() const override;
47  void user_config() override;
48 
49  std::string name() const override;
50 
51  std::string config_name() const override;
52 
53  std::string create_map(utils::optional<uint32_t> randomseed) override;
54  config create_scenario(utils::optional<uint32_t> randomseed) override;
55 
56 private:
57  std::string generate_map(std::map<map_location,std::string>* labels, utils::optional<uint32_t> randomseed);
58 
60 
62 };
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:172
std::string config_name() const override
Return a friendly name for the generator used to differentiate between different configs of the same ...
default_map_generator(const config &game_config)
bool allow_user_config() const override
Returns true if the map generator has an interactive screen, which allows the user to modify how the ...
config create_scenario(utils::optional< uint32_t > randomseed) override
void user_config() override
Display the interactive screen, which allows the user to modify how the generator behaves.
std::string create_map(utils::optional< uint32_t > randomseed) override
Creates a new map and returns it.
std::string name() const override
Returns a string identifying the generator by name.
std::string generate_map(std::map< map_location, std::string > *labels, utils::optional< uint32_t > randomseed)
Definitions for the interface to Wesnoth Markup Language (WML).
Game configuration data as global variables.
Definition: build_info.cpp:61
generator_data()=default