23 #define ERR_WML LOG_STREAM(err, log_wml)
39 std::string cfg_name = prefix +
"name_generator";
40 std::string markov_name = prefix +
"names";
56 if(!markov_name_list.
blank()) {
63 std::map<std::string, std::shared_ptr<name_generator>>::const_iterator it =
name_generators_.find(
"");
66 return std::make_shared<name_generator>();
73 std::map<std::string, std::shared_ptr<name_generator>>::const_iterator it =
name_generators_.find(
id);
Variant for storing WML attributes.
bool blank() const
Tests for an attribute that was never set.
A config object defines a single node in a WML file, with access to child nodes.
bool has_attribute(config_key_type key) const
std::shared_ptr< name_generator > get_name_generator()
Gets the default name generator.
void add_name_generator_from_config(const config &config, const std::string id, const std::string prefix)
Determines a name generator from WML data.
std::map< std::string, std::shared_ptr< name_generator > > name_generators_
name_generator_factory(const config &config, std::vector< std::string > ids)
Creates a new name generator factory.
const char * what() const noexcept
virtual std::string generate() const
std::string id
Text to match against addon_info.tags()
Standard logging facilities (interface).
static lg::log_domain log_wml("wml")
std::stringstream & log_to_chat()
Use this to show WML errors in the ingame chat.
std::string interpolate_variables_into_string(const std::string &str, const string_map *const symbols)
Function which will interpolate variables, starting with '$' in the string 'str' with the equivalent ...
std::vector< std::string > split(const config_attribute_value &val)
std::string::const_iterator iterator