The Battle for Wesnoth  1.19.7+dev
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:

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_
 

Detailed Description

Definition at line 41 of file default_map_generator.hpp.

Constructor & Destructor Documentation

◆ default_map_generator()

default_map_generator::default_map_generator ( const config game_config)

Definition at line 53 of file default_map_generator.cpp.

Member Function Documentation

◆ allow_user_config()

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

◆ config_name()

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

◆ create_map()

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

◆ create_scenario()

config default_map_generator::create_scenario ( utils::optional< uint32_t >  randomseed)
overridevirtual

◆ generate_map()

std::string default_map_generator::generate_map ( std::map< map_location, std::string > *  labels,
utils::optional< uint32_t >  randomseed 
)
private

◆ name()

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

◆ user_config()

void default_map_generator::user_config ( )
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_.

Member Data Documentation

◆ cfg_

config default_map_generator::cfg_
private

Definition at line 59 of file default_map_generator.hpp.

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

◆ data_

generator_data default_map_generator::data_
private

Definition at line 61 of file default_map_generator.hpp.

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


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