]> ruin.nu Git - hbs.git/blobdiff - bs/planet.h
battle algorithms are getting closer.. ;)
[hbs.git] / bs / planet.h
index f98d7234c74e5bdf30c07ae646f68be5c1beb268..2d513618342c26c44253178712b3bea0cfabbcd7 100644 (file)
 
 #include "fleet.h"
 
+typedef std::map<std::string, std::vector<int> > RoidList;
+
 /**This class is the implementation of a planet.
  *
  * Yes I know.. In real life you wouldn't call a planet a fleet, but this isn't
  * 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
   */
 
 class Planet : public Fleet  {
 public: 
        Planet();
-       ~Planet();
-       unsigned score();
+       virtual ~Planet();
+
+       unsigned planetScore() const;
+       void setPlanetScore(unsigned i);
+
+       int roids(std::string type, int tick = 0) const;
+       void setRoids(std::string type, int number);
+
+       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 );
+
+       unsigned m_iScore;
+       RoidList m_Roids;
+       
 };
 
 #endif