m_iETA = 0;
m_sRace = "Cathaar";
}
+
Fleet::~Fleet(){
}
for (map<string, vector<int> >::const_iterator i = m_Fleet.begin(); i != m_Fleet.end(); ++i)
{
- total += i->second[0];
+ if (i->second.size() != 0)
+ total += i->second[0];
}
return total;
for (FleetList::const_iterator i = m_Fleet.begin(); i != m_Fleet.end(); ++i)
{
- tot_score += i->second[tick] * s_Units[i->first].totRes() / 10;
+ if (i->second.size() >= tick)
+ break;
+ tot_score += i->second[tick] * s_Units[i->first].totRes() / 10;
}
return tot_score;
}
+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::setFleet(string unittype, int number)
+{
+ if (m_Fleet[unittype].size() == 0)
+ {
+ m_Fleet[unittype].push_back(number);
+ return;
+ }
+ m_Fleet[unittype][0] = number;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+int Fleet::fleet(string unittype, int tick = 0)
+{
+ if (m_Fleet[unittype].size() == 0)
+ return 0;
+
+ return m_Fleet[unittype][tick];
+}
+
+