The Battle for Wesnoth  1.17.0-dev
default_map_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2021
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(std::optional<uint32_t> randomseed) override;
54  config create_scenario(std::optional<uint32_t> randomseed) override;
55 
56 private:
57  std::string generate_map(std::map<map_location,std::string>* labels, std::optional<uint32_t> randomseed);
58 
60 
62 };
Definitions for the interface to Wesnoth Markup Language (WML).
generator_data()=default
Game configuration data as global variables.
Definition: build_info.cpp:59
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:61