//////////////////////////////////////////////////////////////////////////
//
-void UnitType::setTotalResources(int iTR)
+void UnitType::setResources(std::string type, int i)
{
- m_iTotalResources = iTR;
+ m_Resources[type] = i;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void UnitType::setResources(map<std::string, int> res)
+{
+ m_Resources = res;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+std::map<std::string, int> UnitType::resources()
+{
+ return m_Resources;
}
//////////////////////////////////////////////////////////////////////////
//
int UnitType::totRes() const
{
- return m_iTotalResources;
+ int totres = 0;
+ for (map<string, int>::const_iterator i = m_Resources.begin(); i != m_Resources.end(); ++i)
+ totres += i->second;
+ return totres;
}
//////////////////////////////////////////////////////////////////////////