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

#include <map_generator.hpp>

Inheritance diagram for map_generator:

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 (utils::optional< uint32_t > randomseed={})=0
 Creates a new map and returns it. More...
 
virtual config create_scenario (utils::optional< uint32_t > randomseed={})
 

Detailed Description

Definition at line 33 of file map_generator.hpp.

Constructor & Destructor Documentation

◆ ~map_generator()

virtual map_generator::~map_generator ( )
inlinevirtual

Definition at line 36 of file map_generator.hpp.

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

◆ create_map()

std::string map_generator::create_map ( utils::optional< uint32_t >  randomseed = {})
pure virtual

Creates a new map and returns it.

args may contain arguments to the map generator.

Implemented in cave_map_generator, lua_map_generator, and default_map_generator.

Definition at line 36 of file map_generator.cpp.

References create_scenario().

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

◆ create_scenario()

config map_generator::create_scenario ( utils::optional< uint32_t >  randomseed = {})
virtual

Reimplemented in cave_map_generator, lua_map_generator, and default_map_generator.

Definition at line 30 of file map_generator.cpp.

References create_map().

Referenced by create_map(), and lua_map_generator::create_scenario().

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

Definition at line 48 of file map_generator.cpp.

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


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