]> ruin.nu Git - hbs.git/blobdiff - bs/fleet.cpp
Added the possibility to add new battles.
[hbs.git] / bs / fleet.cpp
index b562b8150186def125235ef19275ef646f15a86e..4989573d87f069b3e3bd6e27c4b009e9a0e7268c 100644 (file)
@@ -67,4 +67,20 @@ string Fleet::Race()
        return m_sRace;
 }
 
+//////////////////////////////////////////////////////////////////////////
+//
+/** This function iterates through m_Fleet and adds all numbers together to
+ * produce a total.
+ */
+int Fleet::NumberOfShips()
+{
+       int total = 0;
+
+       for (map<string, vector<int> >::iterator i = m_Fleet.begin(); i != m_Fleet.end(); i++)
+       {
+               total += m_Fleet[(*i).first][0];
+       }
+
+       return total;
+}