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