OpenXcom
1.0
Open-source clone of the original X-Com
|
Pool of soldier names to generate random names. More...
#include <SoldierNamePool.h>
Public Member Functions | |
SoldierNamePool () | |
Creates a blank pool. More... | |
~SoldierNamePool () | |
Cleans up the pool. | |
void | load (const std::string &filename) |
Loads the pool from YAML. More... | |
std::wstring | genName (SoldierGender *gender) const |
Generates a new name from the pool. More... | |
size_t | genLook (size_t numLooks) |
Generates an int representing the index of the soldier's look, when passed the maximum index value. More... | |
Pool of soldier names to generate random names.
Each pool contains a set of first names (male or female) and last names. The first names define the soldier's gender, and are randomly associated with a last name.
OpenXcom::SoldierNamePool::SoldierNamePool | ( | ) |
Creates a blank pool.
Initializes a new pool with blank lists of names.
size_t OpenXcom::SoldierNamePool::genLook | ( | size_t | numLooks | ) |
Generates an int representing the index of the soldier's look, when passed the maximum index value.
numLooks | The maximum index. |
std::wstring OpenXcom::SoldierNamePool::genName | ( | SoldierGender * | gender | ) | const |
Generates a new name from the pool.
Returns a new random name (first + last) from the lists of names contained within.
gender | Returned gender of the name. |
void OpenXcom::SoldierNamePool::load | ( | const std::string & | filename | ) |
Loads the pool from YAML.
Loads the pool from a YAML file.
filename | YAML file. |