X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Fplanet.h;h=e5c173e0cda880cf44b39c4e9134dcc6ddcbb39a;hb=1cdb85f96705026bbeb6772d7bed34a4825353af;hp=f98d7234c74e5bdf30c07ae646f68be5c1beb268;hpb=0fcfaff680c6974a9b3f2a63704a8eb788d3fe94;p=hbs.git diff --git a/bs/planet.h b/bs/planet.h index f98d723..e5c173e 100644 --- a/bs/planet.h +++ b/bs/planet.h @@ -20,20 +20,40 @@ #include "fleet.h" +typedef std::map > 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, int tick = 0); + void takeRoids(std::string type, int number, int tick = 0); + + void runBattle(std::vector friendly, std::vector hostile); + +protected: + void calcOneTick(Planet* friendly, Fleet* Hostile, std::map >& stealfriendly, std::map >& stealhostile, int tick = 0); + + unsigned m_iScore; + RoidList m_Roids; + }; #endif