#include <lua_map_generator.hpp>
Public Member Functions | |
lua_map_generator (const config &cfg, const config *vars) | |
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... | |
std::string | name () const override |
Returns a string identifying the generator by name. More... | |
std::string | id () const |
std::string | config_name () const override |
Return a friendly name for the generator used to differentiate between different configs of the same generator. More... | |
virtual void | user_config () override |
Display the interactive screen, which allows the user to modify how the generator behaves. More... | |
virtual std::string | create_map (utils::optional< uint32_t > randomseed) override |
Creates a new map and returns it. More... | |
virtual config | create_scenario (utils::optional< uint32_t > randomseed) override |
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 25 of file lua_map_generator.hpp.
Definition at line 30 of file lua_map_generator.cpp.
References config::debug(), config::has_attribute(), lk_, lua_kernel_base::load_core(), wfl::msg(), and s.
|
inlineoverridevirtual |
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 29 of file lua_map_generator.hpp.
References user_config_.
|
inlineoverridevirtual |
Return a friendly name for the generator used to differentiate between different configs of the same generator.
Implements map_generator.
Definition at line 35 of file lua_map_generator.hpp.
References config_name_.
|
overridevirtual |
Creates a new map and returns it.
args may contain arguments to the map generator.
Implements map_generator.
Definition at line 68 of file lua_map_generator.cpp.
References config_name_, mapgen_lua_kernel::create_map(), map_generator::create_map(), create_map_, e, generator_data_, lk_, and wfl::msg().
|
overridevirtual |
Reimplemented from map_generator.
Definition at line 84 of file lua_map_generator.cpp.
References config_name_, mapgen_lua_kernel::create_scenario(), map_generator::create_scenario(), create_scenario_, e, ERR_NG, generator_data_, lk_, and wfl::msg().
|
inline |
Definition at line 33 of file lua_map_generator.hpp.
References id_.
|
inlineoverridevirtual |
Returns a string identifying the generator by name.
The name should not contain spaces.
Implements map_generator.
Definition at line 31 of file lua_map_generator.hpp.
|
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 56 of file lua_map_generator.cpp.
References config_name_, e, generator_data_, lk_, wfl::msg(), mapgen_lua_kernel::user_config(), and user_config_.
|
private |
Definition at line 42 of file lua_map_generator.hpp.
Referenced by config_name(), create_map(), create_scenario(), and user_config().
|
private |
Definition at line 45 of file lua_map_generator.hpp.
Referenced by create_map().
|
private |
Definition at line 46 of file lua_map_generator.hpp.
Referenced by create_scenario().
|
private |
Definition at line 50 of file lua_map_generator.hpp.
Referenced by create_map(), create_scenario(), and user_config().
|
private |
Definition at line 42 of file lua_map_generator.hpp.
Referenced by id().
|
private |
Definition at line 48 of file lua_map_generator.hpp.
Referenced by create_map(), create_scenario(), lua_map_generator(), and user_config().
|
private |
Definition at line 44 of file lua_map_generator.hpp.
Referenced by allow_user_config(), and user_config().