The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
default_map_generator Class Reference

#include <default_map_generator.hpp>

Inheritance diagram for default_map_generator:
Inheritance graph

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_
 

Detailed Description

Definition at line 21 of file default_map_generator.hpp.

Constructor & Destructor Documentation

default_map_generator::default_map_generator ( const config game_config)

Member Function Documentation

bool default_map_generator::allow_user_config ( ) const
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.

std::string default_map_generator::config_name ( ) const
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().

std::string default_map_generator::create_map ( boost::optional< boost::uint32_t randomseed)
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().

config default_map_generator::create_scenario ( boost::optional< boost::uint32_t randomseed)
virtual
std::string default_map_generator::generate_map ( std::map< map_location, std::string > *  labels,
boost::optional< boost::uint32_t randomseed 
)
private
std::string default_map_generator::name ( ) const
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.

void default_map_generator::user_config ( CVideo v)
virtual

Member Data Documentation

size_t default_map_generator::castle_size_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

config default_map_generator::cfg_
private

Definition at line 42 of file default_map_generator.hpp.

Referenced by config_name(), create_scenario(), and generate_map().

size_t default_map_generator::default_height_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), and generate_map().

size_t default_map_generator::default_width_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), and generate_map().

size_t default_map_generator::height_
private
size_t default_map_generator::hill_size_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

size_t default_map_generator::island_size_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

size_t default_map_generator::iterations_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

bool default_map_generator::link_castles_
private

Definition at line 41 of file default_map_generator.hpp.

Referenced by generate_map(), and user_config().

size_t default_map_generator::max_lakes_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), and generate_map().

size_t default_map_generator::nplayers_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

size_t default_map_generator::nvillages_
private

Definition at line 40 of file default_map_generator.hpp.

Referenced by default_map_generator(), generate_map(), and user_config().

bool default_map_generator::show_labels_
private

Definition at line 41 of file default_map_generator.hpp.

Referenced by generate_map(), and user_config().

size_t default_map_generator::width_
private

The documentation for this class was generated from the following files: