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

Method getUsedHangars

src/Savegame/Base.cpp:730–749  ·  view source on GitHub ↗

* Returns the amount of hangars used up * by crafts in the base. * @return Storage space. */

Source from the content-addressed store, hash-verified

728 * @return Storage space.
729 */
730int Base::getUsedHangars() const
731{
732 size_t total = _crafts.size();
733 for (std::vector<Transfer*>::const_iterator i = _transfers.begin(); i != _transfers.end(); ++i)
734 {
735 if ((*i)->getType() == TRANSFER_CRAFT)
736 {
737 total += (*i)->getQuantity();
738 }
739 }
740 for (std::vector<Production*>::const_iterator i = _productions.begin(); i != _productions.end(); ++i)
741 {
742 if ((*i)->getRules()->getCategory() == "STR_CRAFT")
743 {
744 // This should be fixed on the case when (*i)->getInfiniteAmount() == TRUE
745 total += ((*i)->getAmountTotal() - (*i)->getAmountProduced());
746 }
747 }
748 return total;
749}
750
751/**
752 * Returns the total amount of hangars

Callers 6

inUseMethod · 0.80
lstProdClickMethod · 0.80
moreUnitMethod · 0.80
initMethod · 0.80
increaseByValueMethod · 0.80
increaseByValueMethod · 0.80

Calls 6

getCategoryMethod · 0.80
getAmountTotalMethod · 0.80
getAmountProducedMethod · 0.80
getTypeMethod · 0.45
getQuantityMethod · 0.45
getRulesMethod · 0.45

Tested by

no test coverage detected