double Country::GetStockPile(const IMaterial &material ) const { std::map<MaterialKey, double>::const_iterator iter = stockPile.find(material.GetKey()); if (iter == stockPile.end()) return 0; return iter->second; }
bool Country::AddIntoStockPile( double value, IMaterial &material ) { std::map< MaterialKey, double>::const_iterator iter = stockPile.find(material.GetKey()); if (iter == stockPile.end()) stockPile[material] = 0; stockPile[material] += value; return true; }