#include <lua_map_generator.hpp>
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_ |
Definition at line 32 of file lua_map_generator.hpp.
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().
|
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.
|
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_.
|
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().
|
virtual |
Reimplemented from map_generator.
Definition at line 68 of file lua_map_generator.cpp.
References config_name_, mapgen_lua_kernel::create_scenario(), map_generator::create_scenario(), create_scenario_, e, generator_data_, lk_, game_logic::msg(), and game::error::what().
|
inline |
Definition at line 40 of file lua_map_generator.hpp.
References id_.
|
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.
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().
|
private |
Definition at line 49 of file lua_map_generator.hpp.
Referenced by config_name(), create_map(), create_scenario(), and user_config().
|
private |
Definition at line 52 of file lua_map_generator.hpp.
Referenced by create_map().
|
private |
Definition at line 53 of file lua_map_generator.hpp.
Referenced by create_scenario().
|
private |
Definition at line 57 of file lua_map_generator.hpp.
Referenced by create_map(), create_scenario(), and user_config().
|
private |
Definition at line 49 of file lua_map_generator.hpp.
Referenced by id().
|
private |
Definition at line 55 of file lua_map_generator.hpp.
Referenced by create_map(), create_scenario(), and user_config().
|
private |
Definition at line 51 of file lua_map_generator.hpp.
Referenced by user_config().