]> ruin.nu Git - hbs.git/blob - bs/fleet.cpp
35de49b849adc58016de508afd2217036f50da2d
[hbs.git] / bs / fleet.cpp
1 /***************************************************************************
2                           fleet.cpp  -  description
3                              -------------------
4     begin                : Tue Jan 22 2002
5     copyright            : (C) 2002 by Michael Andreen
6     email                : whale@linux.nu
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
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.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #include "fleet.h"
19
20 using namespace std;
21
22 Fleet::Fleet()
23 {
24 }
25 Fleet::~Fleet(){
26 }
27
28 //////////////////////////////////////////////////////////////////////////
29 //
30 void Fleet::setName(string sName)
31 {
32         m_sName = sName;
33 }
34
35 //////////////////////////////////////////////////////////////////////////
36 //
37 string Fleet::Name()
38 {
39         return m_sName;
40 }
41
42 //////////////////////////////////////////////////////////////////////////
43 //
44 /** This function first sets the race, then it iterates through the the 
45  * s_Races and checks if it finds the race it returns true, if it reaches
46  * the end without finding it it returns false.
47  */
48 bool Fleet::setRace(std::string sRace)
49 {
50         m_sRace = sRace;
51   s_Units.begin();
52         for (map<string, vector<int> >::iterator i = s_Races.begin(); i != s_Races.end(); i++)
53         {
54                 if (m_sRace == (*i).first)
55                         return true;
56         }
57         return false;
58 }
59
60 //////////////////////////////////////////////////////////////////////////
61 //
62 string Fleet::Race()
63 {
64         return m_sRace;
65 }
66
67