1 /***************************************************************************
2 fleet.cpp - description
4 begin : Tue Jan 22 2002
5 copyright : (C) 2002 by Michael Andreen
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
23 map<string, vector<int> > Fleet::s_Races;
24 map<string, UnitType > Fleet::s_Units;
33 //////////////////////////////////////////////////////////////////////////
35 void Fleet::setName(string sName)
40 //////////////////////////////////////////////////////////////////////////
47 //////////////////////////////////////////////////////////////////////////
49 /** This function first sets the race, then it iterates through the the
50 * s_Races and checks if it finds the race it returns true, if it reaches
51 * the end without finding it it returns false.
53 bool Fleet::setRace(std::string sRace)
56 for (map<string, vector<int> >::iterator i = s_Races.begin(); i != s_Races.end(); i++)
58 if (m_sRace == (*i).first)
64 //////////////////////////////////////////////////////////////////////////
71 //////////////////////////////////////////////////////////////////////////
73 /** This function iterates through m_Fleet and adds all numbers together to
76 int Fleet::NumberOfShips()
80 for (map<string, vector<int> >::iterator i = m_Fleet.begin(); i != m_Fleet.end(); i++)
82 total += m_Fleet[(*i).first][0];
88 //////////////////////////////////////////////////////////////////////////
90 void Fleet::setETA(int eta)
95 //////////////////////////////////////////////////////////////////////////