MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getCraftString

Method getCraftString

src/Savegame/Soldier.cpp:227–243  ·  view source on GitHub ↗

* Returns the soldier's craft string, which * is either the soldier's wounded status, * the assigned craft name, or none. * @param lang Language to get strings from. * @return Full name. */

Source from the content-addressed store, hash-verified

225 * @return Full name.
226 */
227std::wstring Soldier::getCraftString(Language *lang) const
228{
229 std::wstring s;
230 if (_recovery > 0)
231 {
232 s = lang->getString("STR_WOUNDED");
233 }
234 else if (_craft == 0)
235 {
236 s = lang->getString("STR_NONE_UC");
237 }
238 else
239 {
240 s = _craft->getName(lang);
241 }
242 return s;
243}
244
245/**
246 * Returns a localizable-string representation of

Callers 3

initMethod · 0.80
initMethod · 0.80
CraftArmorStateMethod · 0.80

Calls 2

getStringMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected