]> ruin.nu Git - hbs.git/blobdiff - bs/planet.h
A few more bugs killed.. still a few left before 0.1 release..
[hbs.git] / bs / planet.h
index ccb2ee40f4b5bb7a18ff3ac38bd5699be8680a0b..e5c173e0cda880cf44b39c4e9134dcc6ddcbb39a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "fleet.h"
 
-typedef std::map<std::string, int> RoidList;
+typedef std::map<std::string, std::vector<int> > RoidList;
 
 /**This class is the implementation of a planet.
  *
@@ -28,6 +28,9 @@ typedef std::map<std::string, int> RoidList;
  * real life, it's a game engine, and in this engine a planet got all the 
  * attributes that a fleet got + some additions, so I think the inheritance
  * is fully legal from a OOP standpoint. If it isn't, then please correct me ;)
+ *
+ * This class is doing the actual battle simulation (since battles without 
+ * planets aren't available in this game).
   *@author Michael Andreen
   */
 
@@ -36,10 +39,18 @@ public:
        Planet();
        virtual ~Planet();
 
-       unsigned score(int tick = 0);
-       void setScore(unsigned i);
+       unsigned planetScore() const;
+       void setPlanetScore(unsigned i);
+
+       int roids(std::string type, int tick = 0) const;
+       void setRoids(std::string type, int number, int tick = 0);
+       void takeRoids(std::string type, int number, int tick = 0);
+
+       void runBattle(std::vector<Fleet*> friendly, std::vector<Fleet*> hostile);
 
 protected:
+       void calcOneTick(Planet* friendly, Fleet* Hostile, std::map<std::string, std::map<std::string, int> >& stealfriendly, std::map<std::string, std::map<std::string, int> >&  stealhostile, int tick = 0);
+
        unsigned m_iScore;
        RoidList m_Roids;