+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::printFleet()
+{
+ for (UnitList::iterator i = s_Units.begin(); i != s_Units.end(); ++i)
+ {
+ for (int tick = 0; tick < 5 ;++tick)
+ {
+ int num = fleet(i->first, tick);
+
+ if (num <= 0)
+ break;
+ cerr << num << " " << i->first << " during tick: " << tick << endl;
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::blockFleet(std::string unittype, int number, int tick = 0)
+{
+ if (m_BlockedFleet[unittype].size() >= 1)
+ {
+ m_BlockedFleet[unittype][0] += number;
+ if (m_BlockedFleet[unittype].size() > 1)
+ m_BlockedFleet[unittype][1] += number;
+ else
+ m_BlockedFleet[unittype].push_back(m_BlockedFleet[unittype][0]);
+ }
+ else
+ {
+ m_BlockedFleet[unittype].push_back(number);
+ m_BlockedFleet[unittype].push_back(number);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::distributeCappedRoids(std::vector<Fleet*> fleets, int tick = 0)
+{
+ for (ResourceList::iterator i = m_Resources.begin(); i != m_Resources.end(); ++i)
+ {
+ string res = i->first;
+
+ cerr << "Distributing type: " << res << endl;
+ for (vector<int>::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ cout << (*j) << endl;
+
+ if (m_Resources[res].size() < 2)
+ continue;
+ if (m_Resources[res][1] == 0)
+ continue;
+
+
+ int totcapped = resource(res,1) - resource(res, 0);
+
+
+ cerr << "Distributing type: " << res << " with a total gain of " << totcapped << " roids" << endl;
+
+ cerr << "Total number of roids before: " << resource(res, 0) << " and after : " << resource(res, 1) << endl;
+
+ for (vector<Fleet*>::iterator j = fleets.begin(); j != fleets.end(); ++j)
+ {
+ unsigned fl1 = (*j)->score(tick - 1);
+ float part = float(fl1) / score(0) ;
+ int lost = totcapped * part;
+
+ cerr << (*j)->name() << " gaining " << lost << " " << res << " since it's " << part * 100 << "% of the whole score, and it had : " << fl1 << " score last tick.. compared to fleet total of: " << score(0) << endl;
+ (*j)->setResource(res, (*j)->resource(res,tick-1) + lost, tick);
+ }
+ }
+}
+
+