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 Attributes | List of all members
lua_map_generator Class Reference

#include <lua_map_generator.hpp>

Inheritance diagram for lua_map_generator:
Inheritance graph

Public Member Functions

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

Private Attributes

std::string id_
 
std::string config_name_
 
std::string user_config_
 
std::string create_map_
 
std::string create_scenario_
 
mapgen_lua_kernel lk_
 
config generator_data_
 

Detailed Description

Definition at line 32 of file lua_map_generator.hpp.

Constructor & Destructor Documentation

lua_map_generator::lua_map_generator ( const config cfg)

Definition at line 23 of file lua_map_generator.cpp.

References config::debug(), config::has_attribute(), and game_logic::msg().

Member Function Documentation

bool lua_map_generator::allow_user_config ( ) const
inlinevirtual

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 36 of file lua_map_generator.hpp.

std::string lua_map_generator::config_name ( ) const
inlinevirtual

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

Implements map_generator.

Definition at line 42 of file lua_map_generator.hpp.

References config_name_.

std::string lua_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 56 of file lua_map_generator.cpp.

References config_name_, mapgen_lua_kernel::create_map(), create_map_, e, generator_data_, lk_, game_logic::msg(), and game::error::what().

config lua_map_generator::create_scenario ( boost::optional< boost::uint32_t randomseed)
virtual
std::string lua_map_generator::id ( ) const
inline

Definition at line 40 of file lua_map_generator.hpp.

References id_.

std::string lua_map_generator::name ( ) const
inlinevirtual

Returns a string identifying the generator by name.

The name should not contain spaces.

Implements map_generator.

Definition at line 38 of file lua_map_generator.hpp.

void lua_map_generator::user_config ( CVideo v)
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 from map_generator.

Definition at line 43 of file lua_map_generator.cpp.

References config_name_, e, generator_data_, lk_, game_logic::msg(), lua_kernel_base::set_video(), mapgen_lua_kernel::user_config(), user_config_, and game::error::what().

Member Data Documentation

std::string lua_map_generator::config_name_
private

Definition at line 49 of file lua_map_generator.hpp.

Referenced by config_name(), create_map(), create_scenario(), and user_config().

std::string lua_map_generator::create_map_
private

Definition at line 52 of file lua_map_generator.hpp.

Referenced by create_map().

std::string lua_map_generator::create_scenario_
private

Definition at line 53 of file lua_map_generator.hpp.

Referenced by create_scenario().

config lua_map_generator::generator_data_
private

Definition at line 57 of file lua_map_generator.hpp.

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

std::string lua_map_generator::id_
private

Definition at line 49 of file lua_map_generator.hpp.

Referenced by id().

mapgen_lua_kernel lua_map_generator::lk_
private

Definition at line 55 of file lua_map_generator.hpp.

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

std::string lua_map_generator::user_config_
private

Definition at line 51 of file lua_map_generator.hpp.

Referenced by user_config().


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