The Battle for Wesnoth  1.17.23+dev
markov_generator.cpp File Reference

Generate race-specific unit-names. More...

#include "utils/markov_generator.hpp"
#include "serialization/unicode_cast.hpp"
#include "random.hpp"
Include dependency graph for markov_generator.cpp:

Go to the source code of this file.


static void add_prefixes (const std::u32string &str, std::size_t length, markov_prefix_map &res)
static markov_prefix_map markov_prefixes (const std::vector< std::string > &items, std::size_t length)
static std::u32string markov_generate_name (const markov_prefix_map &prefixes, std::size_t chain_size, std::size_t max_len)

Detailed Description

Generate race-specific unit-names.

Definition in file markov_generator.cpp.

Function Documentation

◆ add_prefixes()

static void add_prefixes ( const std::u32string &  str,
std::size_t  length,
markov_prefix_map res 

Definition at line 26 of file markov_generator.cpp.

References c, i, and editor::start().

Referenced by markov_prefixes().

◆ markov_generate_name()

static std::u32string markov_generate_name ( const markov_prefix_map prefixes,
std::size_t  chain_size,
std::size_t  max_len 

Definition at line 47 of file markov_generator.cpp.

References c, randomness::generator, i, and randomness::rng::next_random().

Referenced by markov_generator::generate().

◆ markov_prefixes()

static markov_prefix_map markov_prefixes ( const std::vector< std::string > &  items,
std::size_t  length 

Definition at line 36 of file markov_generator.cpp.

References add_prefixes(), i, and mp::ui_alerts::items.