]> ruin.nu Git - hbs.git/blob - bs/planet.h
adding, removing and chaning fleets now works.
[hbs.git] / bs / planet.h
1 /***************************************************************************
2                           planet.h  -  description
3                              -------------------
4     begin                : Wed Apr 3 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 PLANET_H
19 #define PLANET_H
20
21 #include "fleet.h"
22
23 typedef std::map<std::string, std::vector<int> > RoidList;
24
25 /**This class is the implementation of a planet.
26  *
27  * Yes I know.. In real life you wouldn't call a planet a fleet, but this isn't
28  * real life, it's a game engine, and in this engine a planet got all the 
29  * attributes that a fleet got + some additions, so I think the inheritance
30  * is fully legal from a OOP standpoint. If it isn't, then please correct me ;)
31   *@author Michael Andreen
32   */
33
34 class Planet : public Fleet  {
35 public: 
36         Planet();
37         virtual ~Planet();
38
39         unsigned planetScore() const;
40         void setPlanetScore(unsigned i);
41
42         int roids(std::string type, int tick = 0) const;
43         void setRoids(std::string type, int number);
44
45         void runBattle(std::vector<Fleet*> friendly, std::vector<Fleet*> hostile);
46
47 protected:
48         unsigned m_iScore;
49         RoidList m_Roids;
50         
51 };
52
53 #endif