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

Method getTotalScientists

src/Savegame/Base.cpp:476–494  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

474 * @return Number of scientists.
475 */
476int Base::getTotalScientists() const
477{
478 int total = _scientists;
479 for (std::vector<Transfer*>::const_iterator i = _transfers.begin(); i != _transfers.end(); ++i)
480 {
481 if ((*i)->getType() == TRANSFER_SCIENTIST)
482 {
483 total += (*i)->getQuantity();
484 }
485 }
486 const std::vector<ResearchProject *> & research (getResearch());
487 for (std::vector<ResearchProject *>::const_iterator itResearch = research.begin ();
488 itResearch != research.end ();
489 ++itResearch)
490 {
491 total += (*itResearch)->getAssigned ();
492 }
493 return total;
494}
495
496/**
497 * Returns the amount of engineers contained

Callers 3

MonthlyCostsStateMethod · 0.80
initMethod · 0.80
PurchaseStateMethod · 0.80

Calls 3

getAssignedMethod · 0.80
getTypeMethod · 0.45
getQuantityMethod · 0.45

Tested by

no test coverage detected