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

Method getNumSoldiers

src/Savegame/Craft.cpp:421–435  ·  view source on GitHub ↗

* Returns the amount of soldiers from a list * that are currently attached to this craft. * @return Number of soldiers. */

Source from the content-addressed store, hash-verified

419 * @return Number of soldiers.
420 */
421int Craft::getNumSoldiers() const
422{
423 if (_rules->getSoldiers() == 0)
424 return 0;
425
426 int total = 0;
427
428 for (std::vector<Soldier*>::iterator i = _base->getSoldiers()->begin(); i != _base->getSoldiers()->end(); ++i)
429 {
430 if ((*i)->getCraft() == this)
431 total++;
432 }
433
434 return total;
435}
436
437/**
438 * Returns the amount of equipment currently

Callers 15

destroyFacilityMethod · 0.80
ufoReachedWaypointMethod · 0.80
runInventoryMethod · 0.80
initMethod · 0.80
increaseByValueMethod · 0.80
decreaseByValueMethod · 0.80
CraftEquipmentStateMethod · 0.80
btnInventoryClickMethod · 0.80
initMethod · 0.80
btnOkClickMethod · 0.80
cbxCraftChangeMethod · 0.80
GeoscapeCraftStateMethod · 0.80

Calls 2

getSoldiersMethod · 0.45
getCraftMethod · 0.45

Tested by

no test coverage detected