The Battle for Wesnoth  1.15.1+dev
Public Member Functions | List of all members
map_generator Class Referenceabstract

#include <map_generator.hpp>

Inheritance diagram for map_generator:
Inheritance graph

Public Member Functions

virtual ~map_generator ()
 
virtual 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...
 
virtual void user_config ()
 Display the interactive screen, which allows the user to modify how the generator behaves. More...
 
virtual std::string name () const =0
 Returns a string identifying the generator by name. More...
 
virtual std::string config_name () const =0
 Return a friendly name for the generator used to differentiate between different configs of the same generator. More...
 
virtual std::string create_map (boost::optional< uint32_t > randomseed=boost::none)=0
 Creates a new map and returns it. More...
 
virtual config create_scenario (boost::optional< uint32_t > randomseed=boost::none)
 

Detailed Description

Definition at line 34 of file map_generator.hpp.

Constructor & Destructor Documentation

◆ ~map_generator()

virtual map_generator::~map_generator ( )
inlinevirtual

Definition at line 37 of file map_generator.hpp.

References name().

Member Function Documentation

◆ allow_user_config()

bool 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 in default_map_generator, and lua_map_generator.

Definition at line 43 of file map_generator.cpp.

◆ config_name()

virtual std::string map_generator::config_name ( ) const
pure virtual

Return a friendly name for the generator used to differentiate between different configs of the same generator.

Implemented in default_map_generator, cave_map_generator, and lua_map_generator.

◆ create_map()

std::string map_generator::create_map ( boost::optional< uint32_t >  randomseed = boost::none)
pure virtual

Creates a new map and returns it.

args may contain arguments to the map generator.

Implemented in default_map_generator, lua_map_generator, and cave_map_generator.

Definition at line 36 of file map_generator.cpp.

References create_scenario().

Referenced by lua_map_generator::create_map(), create_scenario(), editor::context_manager::generate_map_dialog(), and random_generate_map().

◆ create_scenario()

config map_generator::create_scenario ( boost::optional< uint32_t >  randomseed = boost::none)
virtual

◆ name()

virtual std::string map_generator::name ( ) const
pure virtual

Returns a string identifying the generator by name.

The name should not contain spaces.

Implemented in default_map_generator, cave_map_generator, and lua_map_generator.

◆ user_config()

void map_generator::user_config ( )
virtual

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 in default_map_generator, and lua_map_generator.

Definition at line 48 of file map_generator.cpp.

References main().

Referenced by gui2::dialogs::editor_generate_map::do_settings().


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