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

Method getCraftCount

src/Savegame/Base.cpp:887–898  ·  view source on GitHub ↗

* Returns the total amount of craft of * a certain type stored in the base. * @param craft Craft type. * @return Number of craft. */

Source from the content-addressed store, hash-verified

885 * @return Number of craft.
886 */
887int Base::getCraftCount(const std::string &craft) const
888{
889 int total = 0;
890 for (std::vector<Craft*>::const_iterator i = _crafts.begin(); i != _crafts.end(); ++i)
891 {
892 if ((*i)->getRules()->getType() == craft)
893 {
894 total++;
895 }
896 }
897 return total;
898}
899
900/**
901 * Returns the total amount of monthly costs

Callers 1

MonthlyCostsStateMethod · 0.80

Calls 2

getTypeMethod · 0.45
getRulesMethod · 0.45

Tested by

no test coverage detected