+
+//////////////////////////////////////////////////////////////////////////
+//
+std::map<std::string, int*> Fleet::findTargets(std::string targetClass,int& total, int attackerType)
+{
+ map<string, int*> targets;
+
+ for (UnitList::iterator i = s_Units.begin(); i != s_Units.end(); ++i)
+ {
+ if (m_Fleet[i->first].size() == 0)
+ continue;
+
+
+ if (m_Fleet[i->first].size() == 1 )
+ m_Fleet[i->first].push_back(m_Fleet[i->first][0]);
+
+ //cerr << "Target is class: " << j->second.type() << endl;
+
+ if (m_Fleet[i->first][1] > 0 && ( targetClass == i->second.unitClass() || targetClass == "All"))
+ {
+ if (i->second.unitClass() == "PDS" && attackerType == 1)
+ continue;
+ // cerr << "Looking at target: " << j->first << endl;
+ targets[i->first] = &m_Fleet[i->first][1];
+ total += m_Fleet[i->first][1];
+ }
+ }
+
+ return targets;
+}