#include <default_map_generator.hpp>
Public Member Functions | |
default_map_generator (const config &game_config) | |
bool | allow_user_config () const |
Returns true if the map generator has an interactive screen, which allows the user to modify how the generator behaves. More... | |
void | user_config (CVideo &v) |
Display the interactive screen, which allows the user to modify how the generator behaves. More... | |
std::string | name () const |
Returns a string identifying the generator by name. More... | |
std::string | config_name () const |
Return a friendly name for the generator used to differentiate between different configs of the same generator. More... | |
std::string | create_map (boost::optional< boost::uint32_t > randomseed) |
Creates a new map and returns it. More... | |
config | create_scenario (boost::optional< boost::uint32_t > randomseed) |
Public Member Functions inherited from map_generator | |
virtual | ~map_generator () |
Private Member Functions | |
std::string | generate_map (std::map< map_location, std::string > *labels, boost::optional< boost::uint32_t > randomseed) |
Private Attributes | |
size_t | default_width_ |
size_t | default_height_ |
size_t | width_ |
size_t | height_ |
size_t | island_size_ |
size_t | iterations_ |
size_t | hill_size_ |
size_t | max_lakes_ |
size_t | nvillages_ |
size_t | castle_size_ |
size_t | nplayers_ |
bool | link_castles_ |
bool | show_labels_ |
config | cfg_ |
Definition at line 21 of file default_map_generator.hpp.
default_map_generator::default_map_generator | ( | const config & | game_config | ) |
Definition at line 39 of file default_map_generator.cpp.
References castle_size_, default_height_, default_width_, height_, hill_size_, island_size_, iterations_, max_lakes_, nplayers_, nvillages_, and width_.
|
virtual |
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 97 of file default_map_generator.cpp.
|
virtual |
Return a friendly name for the generator used to differentiate between different configs of the same generator.
Implements map_generator.
Definition at line 341 of file default_map_generator.cpp.
References cfg_, and config::child().
|
virtual |
Creates a new map and returns it.
args may contain arguments to the map generator.
Implements map_generator.
Definition at line 349 of file default_map_generator.cpp.
References generate_map().
|
virtual |
Reimplemented from map_generator.
Definition at line 430 of file default_map_generator.cpp.
References config::add_child(), cfg_, config::child_or_empty(), DBG_NG, generate_map(), height_, i, game::error::message, and width_.
|
private |
Definition at line 354 of file default_map_generator.cpp.
References castle_size_, cfg_, DBG_NG, default_map_generator_job::default_generate_map(), default_height_, default_width_, height_, hill_size_, is_odd(), island_size_, iterations_, link_castles_, max_lakes_, game::error::message, seed_rng::next_seed(), nplayers_, nvillages_, show_labels_, and width_.
Referenced by create_map(), and create_scenario().
|
virtual |
Returns a string identifying the generator by name.
The name should not contain spaces.
Implements map_generator.
Definition at line 339 of file default_map_generator.cpp.
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 99 of file default_map_generator.cpp.
References _(), castle_size_, gui::button::checked(), sdl::create_rect(), gui::dialog_frame::default_style, CVideo::delay(), gui::dialog_frame::draw(), font::draw_text(), CVideo::flip(), translation::gettext(), CVideo::getx(), CVideo::gety(), height_, hill_size_, int(), island_size_, iterations_, gui::dialog_frame::layout(), link_castles_, gamemap::MAX_PLAYERS, N_, font::NORMAL_COLOR, nplayers_, nvillages_, gui::button::pressed(), events::pump(), events::raise_draw_event(), events::raise_process_event(), surface_restorer::restore(), resources::screen, screen_area(), gui::button::set_check(), gui::widget::set_dirty(), gui::widget::set_location(), gui::slider::set_location(), gui::slider::set_max(), gui::slider::set_min(), gui::slider::set_value(), show_labels_, font::SIZE_NORMAL, gui::button::TYPE_CHECK, update_rect(), gui::slider::value(), and width_.
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 42 of file default_map_generator.hpp.
Referenced by config_name(), create_scenario(), and generate_map().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), and generate_map().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), and generate_map().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by create_scenario(), default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 41 of file default_map_generator.hpp.
Referenced by generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), and generate_map().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by default_map_generator(), generate_map(), and user_config().
|
private |
Definition at line 41 of file default_map_generator.hpp.
Referenced by generate_map(), and user_config().
|
private |
Definition at line 40 of file default_map_generator.hpp.
Referenced by create_scenario(), default_map_generator(), generate_map(), and user_config().