OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SoldierNamePool.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_SOLDIERNAMEPOOL_H
20 #define OPENXCOM_SOLDIERNAMEPOOL_H
21 
22 #include <string>
23 #include <vector>
24 #include "../Savegame/Soldier.h"
25 
26 namespace OpenXcom
27 {
28 
36 {
37 private:
38  std::vector<std::wstring> _maleFirst, _femaleFirst, _maleLast, _femaleLast;
39  std::vector<int> _lookWeights;
40  int _totalWeight;
41 public:
47  void load(const std::string &filename);
49  std::wstring genName(SoldierGender *gender) const;
51  size_t genLook(size_t numLooks);
52 };
53 
54 }
55 
56 #endif
std::wstring genName(SoldierGender *gender) const
Generates a new name from the pool.
Definition: SoldierNamePool.cpp:93
~SoldierNamePool()
Cleans up the pool.
Definition: SoldierNamePool.cpp:42
size_t genLook(size_t numLooks)
Generates an int representing the index of the soldier's look, when passed the maximum index value...
Definition: SoldierNamePool.cpp:127
Pool of soldier names to generate random names.
Definition: SoldierNamePool.h:35
SoldierNamePool()
Creates a blank pool.
Definition: SoldierNamePool.cpp:35
void load(const std::string &filename)
Loads the pool from YAML.
Definition: SoldierNamePool.cpp:50