#include <default_map_generator.hpp>
Public Member Functions | |
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 generator behaves. More... | |
void | user_config () override |
Display the interactive screen, which allows the user to modify how the generator behaves. More... | |
std::string | name () const override |
Returns a string identifying the generator by name. More... | |
std::string | config_name () const override |
Return a friendly name for the generator used to differentiate between different configs of the same generator. More... | |
std::string | create_map (utils::optional< uint32_t > randomseed) override |
Creates a new map and returns it. More... | |
config | create_scenario (utils::optional< uint32_t > randomseed) override |
Public Member Functions inherited from map_generator | |
virtual | ~map_generator () |
Private Member Functions | |
std::string | generate_map (std::map< map_location, std::string > *labels, utils::optional< uint32_t > randomseed) |
Private Attributes | |
config | cfg_ |
generator_data | data_ |
Definition at line 41 of file default_map_generator.hpp.
default_map_generator::default_map_generator | ( | const config & | game_config | ) |
Definition at line 53 of file default_map_generator.cpp.
|
overridevirtual |
Returns true if the map generator has an interactive screen, which allows the user to modify how the generator behaves.
by default we don't allow user configs.
Reimplemented from map_generator.
Definition at line 59 of file default_map_generator.cpp.
|
overridevirtual |
Return a friendly name for the generator used to differentiate between different configs of the same generator.
Implements map_generator.
Definition at line 68 of file default_map_generator.cpp.
References c, cfg_, and config::optional_child().
|
overridevirtual |
Creates a new map and returns it.
args may contain arguments to the map generator.
Implements map_generator.
Definition at line 76 of file default_map_generator.cpp.
References generate_map().
|
overridevirtual |
Reimplemented from map_generator.
Definition at line 169 of file default_map_generator.cpp.
References _(), config::add_child(), cfg_, config::child_or_empty(), data_, DBG_NG, generate_map(), generator_data::height, i, label, game::error::message, and generator_data::width.
|
private |
Definition at line 81 of file default_map_generator.cpp.
References cfg_, data_, DBG_NG, default_map_generator_job::default_generate_map(), generator_data::default_height, generator_data::default_width, generator_data::height, is_odd(), generator_data::island_off_center, generator_data::island_size, generator_data::iterations, gui2::dialogs::max_coastal, generator_data::max_lakes, game::error::message, seed_rng::next_seed(), generator_data::nvillages, generator_data::show_labels, and generator_data::width.
Referenced by create_map(), and create_scenario().
|
overridevirtual |
Returns a string identifying the generator by name.
The name should not contain spaces.
Implements map_generator.
Definition at line 66 of file default_map_generator.cpp.
|
overridevirtual |
Display the interactive screen, which allows the user to modify how the generator behaves.
(This function will not be called if allow_user_config() returns false).
Reimplemented from map_generator.
Definition at line 61 of file default_map_generator.cpp.
References data_.
|
private |
Definition at line 59 of file default_map_generator.hpp.
Referenced by config_name(), create_scenario(), and generate_map().
|
private |
Definition at line 61 of file default_map_generator.hpp.
Referenced by create_scenario(), generate_map(), and user_config().