]> ruin.nu Git - hbs.git/blob - bs/fleet.h
initial commit of the BSConf class.
[hbs.git] / bs / fleet.h
1 /***************************************************************************
2                           fleet.h  -  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 #ifndef FLEET_H
19 #define FLEET_H
20
21 #include <map>
22 #include <string>
23 #include <vector>
24
25 #include "unittype.h"
26
27 //!This is the engine for the whole battlesystem.
28 /**This is the engine for the whole battlesystem.
29   *     One of the few parts that I plan make fully portable.
30   *\todo LOTS (I think ;)
31   *@author Michael Andreen
32   */
33 class Fleet 
34 {
35 public: 
36         Fleet();
37         ~Fleet();
38
39         /**Sets the name that represents this fleet. Might be different a name
40          * like foobar or some coordinates like 1:1:1. The name doesn't have to be unique,
41          * since it's up to the rest of the program to handle that part.
42          * \see Name
43          */
44         void   setName(std::string sName);
45         /**Returns the name of this fleet.
46          * \see setName
47          */
48         std::string Name();
49
50         /**The race string decides what type of ships this fleet can have.
51          * The values must be feeded into this class.
52          * \param sRace This is just the name of the race. It's case-sensitive.
53          * \return If the race is available this function returns true, if not false is returned. The race is set in both cases though.
54          * \see Race
55          */
56         bool   setRace(std::string sRace);
57         /**Just returns what race this fleet belongs to.. 
58          * \return The race, represented as a string.
59          * \see setRace
60          */
61         std::string Race();
62
63         /**Returns the total number of ships in this fleet
64          */
65         int NumberOfShips();
66
67         /**Sets the estimated time of arrival. The time as a single integer,
68          * in relation to the current time. For example if the current time is
69          * 10, and the arrival is at 12, then the eta is 2.
70          */
71         void setETA(int eta);
72         /**Return the estimated time of arrival. It's counted from the current time (tick).
73          */
74         int  ETA();
75
76
77 protected:
78         std::string     m_sName;
79         std::string     m_sRace;
80         int         m_iETA;
81         std::map<std::string, std::vector<int> >        m_Fleet;
82
83         static std::map<std::string, UnitType>  s_Units;
84         static std::map<std::string, std::vector<int> > s_Races;
85 };
86
87 #endif