The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
default_map_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2017 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project http://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 
23  int width;
24  int height;
27  int nplayers;
28  int nvillages;
30  int hill_size;
34  int max_lakes;
37 };
38 
40 {
41 public:
43 
44  bool allow_user_config() const override;
45  void user_config() override;
46 
47  std::string name() const override;
48 
49  std::string config_name() const override;
50 
51  std::string create_map(boost::optional<uint32_t> randomseed) override;
52  config create_scenario(boost::optional<uint32_t> randomseed) override;
53 
54 private:
55  std::string generate_map(std::map<map_location,std::string>* labels, boost::optional<uint32_t> randomseed);
56 
58 
60 };
generator_data(const config &cfg)
std::vector< char_t > string
std::string name() const override
Returns a string identifying the generator by name.
Definitions for the interface to Wesnoth Markup Language (WML).
std::string config_name() const override
Return a friendly name for the generator used to differentiate between different configs of the same ...
std::string create_map(boost::optional< uint32_t > randomseed) override
Creates a new map and returns it.
config create_scenario(boost::optional< uint32_t > randomseed) override
void user_config() override
Display the interactive screen, which allows the user to modify how the generator behaves...
bool allow_user_config() const override
Returns true if the map generator has an interactive screen, which allows the user to modify how the ...
Game configuration data as global variables.
Definition: build_info.cpp:53
default_map_generator(const config &game_config)
std::string generate_map(std::map< map_location, std::string > *labels, boost::optional< uint32_t > randomseed)
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:93