Example #1
0
	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;
	}
Example #2
0
	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;
	}