25 , config_name_(cfg[
"config_name"])
26 , user_config_(cfg[
"user_config"])
27 , create_map_(cfg[
"create_map"])
28 , create_scenario_(cfg[
"create_scenario"])
30 , generator_data_(cfg)
32 const char* required[] = {
"id",
"config_name",
"create_map"};
35 std::string msg =
"Error when constructing a lua map generator -- missing a required attribute '";
37 msg +=
"Config was '" + cfg.
debug() +
"'";
49 std::string msg =
"Error when running lua_map_generator user_config.\n";
61 std::string msg =
"Error when running lua_map_generator create_map.\n";
77 std::string msg =
"Error when running lua_map_generator create_scenario.\n";
const char * what() const
virtual std::string create_map(boost::optional< boost::uint32_t > randomseed)
Creates a new map and returns it.
std::string debug() const
virtual config create_scenario(boost::optional< boost::uint32_t > randomseed=boost::none)
Definitions for the interface to Wesnoth Markup Language (WML).
config create_scenario(const char *prog, const config &generator, boost::optional< boost::uint32_t > seed)
virtual void user_config(CVideo &v)
Display the interactive screen, which allows the user to modify how the generator behaves...
virtual config create_scenario(boost::optional< boost::uint32_t > randomseed)
void user_config(const char *prog, const config &generator)
void set_video(CVideo *ptr)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
lua_map_generator(const config &cfg)
bool has_attribute(const std::string &key) const
std::string create_scenario_
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
std::string create_map(const char *prog, const config &generator, boost::optional< boost::uint32_t > seed)
Error used to report an error in a lua script or in the lua interpreter.