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

Method getTotalSoldiers

src/Savegame/Base.cpp:448–459  ·  view source on GitHub ↗

* Returns the total amount of soldiers contained * in the base. * @return Number of soldiers. */

Source from the content-addressed store, hash-verified

446 * @return Number of soldiers.
447 */
448int Base::getTotalSoldiers() const
449{
450 size_t total = _soldiers.size();
451 for (std::vector<Transfer*>::const_iterator i = _transfers.begin(); i != _transfers.end(); ++i)
452 {
453 if ((*i)->getType() == TRANSFER_SOLDIER)
454 {
455 total += (*i)->getQuantity();
456 }
457 }
458 return total;
459}
460
461/**
462 * Returns the amount of scientists contained

Callers 3

initMethod · 0.80
SoldierMemorialStateMethod · 0.80
PurchaseStateMethod · 0.80

Calls 2

getTypeMethod · 0.45
getQuantityMethod · 0.45

Tested by

no test coverage detected