The Battle for Wesnoth  1.15.0-dev
default_map_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
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 
17 #include "config.hpp"
19 
21  generator_data(const config& cfg);
22  generator_data() = default;
23 
24  int width;
25  int height;
28  int nplayers;
29  int nvillages;
31  int hill_size;
35  int max_lakes;
38 };
39 
41 {
42 public:
44 
45  bool allow_user_config() const override;
46  void user_config() override;
47 
48  std::string name() const override;
49 
50  std::string config_name() const override;
51 
52  std::string create_map(boost::optional<uint32_t> randomseed) override;
53  config create_scenario(boost::optional<uint32_t> randomseed) override;
54 
55 private:
56  std::string generate_map(std::map<map_location,std::string>* labels, boost::optional<uint32_t> randomseed);
57 
59 
61 };
Definitions for the interface to Wesnoth Markup Language (WML).
generator_data()=default
static const char * name(const std::vector< SDL_Joystick *> &joysticks, const std::size_t index)
Definition: joystick.cpp:48
Game configuration data as global variables.
Definition: build_info.cpp:49
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:92