race.cpp File Reference

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

#include "global.hpp"
#include "race.hpp"
#include "random.hpp"
#include "serialization/string_utils.hpp"
#include <cstdlib>

Include dependency graph for race.cpp:

Go to the source code of this file.

Functions

static void add_prefixes (const wide_string &str, size_t length, markov_prefix_map &res)
static markov_prefix_map markov_prefixes (const std::vector< std::string > &items, size_t length)
static wide_string markov_generate_name (const markov_prefix_map &prefixes, size_t chain_size, size_t max_len, simple_rng *rng)
std::string const & gender_string (unit_race::GENDER gender)
unit_race::GENDER string_gender (const std::string &str, unit_race::GENDER def)

Variables

config::child_list empty_traits


Detailed Description

Generate race-specific unit-names.

Definition in file race.cpp.


Function Documentation

static void add_prefixes ( const wide_string str,
size_t  length,
markov_prefix_map res 
) [static]

Definition at line 32 of file race.cpp.

Referenced by markov_prefixes().

std::string const& gender_string ( unit_race::GENDER  gender  ) 

static wide_string markov_generate_name ( const markov_prefix_map prefixes,
size_t  chain_size,
size_t  max_len,
simple_rng rng 
) [static]

Definition at line 53 of file race.cpp.

References get_random(), and simple_rng::get_random().

Referenced by unit_race::generate_name().

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

Definition at line 42 of file race.cpp.

References add_prefixes(), and utils::string_to_wstring().

Referenced by unit_race::unit_race().

unit_race::GENDER string_gender ( const std::string &  str,
unit_race::GENDER  def 
)


Variable Documentation

Definition at line 28 of file race.cpp.


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs