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

Method getTotalSize

src/Savegame/ItemContainer.cpp:141–149  ·  view source on GitHub ↗

* Returns the total size of the items in the container. * @param rule Pointer to ruleset. * @return Total item size. */

Source from the content-addressed store, hash-verified

139 * @return Total item size.
140 */
141double ItemContainer::getTotalSize(const Ruleset *rule) const
142{
143 double total = 0;
144 for (std::map<std::string, int>::const_iterator i = _qty.begin(); i != _qty.end(); ++i)
145 {
146 total += rule->getItem(i->first)->getSize() * i->second;
147 }
148 return total;
149}
150
151/**
152 * Returns all the items currently contained within.

Callers 3

getUsedStoresMethod · 0.80
increaseByValueMethod · 0.80
decreaseByValueMethod · 0.80

Calls 2

getSizeMethod · 0.45
getItemMethod · 0.45

Tested by

no test coverage detected