X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Ffleet.h;h=6696151a51303f0b4f070d05d11d5c422ed07fe4;hb=924d4cd0f8c9c340c8ba6f2e5759fed8f0c83573;hp=770bf0652f4b46c060f57802116d222089d7e293;hpb=1c8c7800411f2491d9be16c0f1515a91525f2e56;p=hbs.git diff --git a/bs/fleet.h b/bs/fleet.h index 770bf06..6696151 100644 --- a/bs/fleet.h +++ b/bs/fleet.h @@ -106,6 +106,11 @@ public: * other is hardly used other than inside the engine. */ void setFleet(std::string unittype, int number, int tick = 0); + + void addFleet(std::string unittype, int number, int tick = 0); + + void addFleet(std::map units, int tick = 0); + /**Returns the numbers of units fo a specific type at a specific tick. * \param unittype The shipname, as a std string * \param tick The tick you want to look at, tick 0 (before battle) is default @@ -221,6 +226,14 @@ public: */ int resource(std::string type, int tick = 0)const; + void resetResources(); + + /** This function tells how many ticks the fleet stays at it's target. + * \returns the number of ticks as an int. + */ + int stays() const; + void setStays(int ticks); + /** This is a little more advanced function. It makes a a number of units * of a specific unittype shoot at the current fleet and calculates the * losses. @@ -251,6 +264,11 @@ public: */ void takeEMP(std::string unittype, int number); + void calculateLostStealships(std::string unittype, std::map stolen, int tick = 1); + + void distributeStolenShips(std::map > stolen, std::vector fleets, int tick = 0); + + void calculateSalvage(); /** This function prints out all the ships in the fleet to stderr, * mainly used for debugging. */ @@ -282,13 +300,14 @@ public: protected: - std::string m_sName; - std::string m_sRace; - int m_iETA; - FleetList m_Fleet; - FleetList m_BlockedFleet; + std::string m_sName; + std::string m_sRace; + int m_iETA; + FleetList m_Fleet; + FleetList m_BlockedFleet; ResourceList m_Resources; - ArmorList m_Armor; + ArmorList m_Armor; + int m_iStays;