The Battle for Wesnoth  1.19.5+dev
Functions
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.

Functions

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 
)
static

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 
)
static

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 
)
static

Definition at line 36 of file markov_generator.cpp.

References add_prefixes(), and i.