X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Ffleet.h;h=2ae03e7c01683a34d1321a99db3073bed3f905fd;hb=refs%2Fheads%2Fmaster;hp=93bdee74a247d04ad4c75db9b173a515ce8707aa;hpb=217cda78005f993fd6b2e575d4abd97c93cec655;p=hbs.git diff --git a/bs/fleet.h b/bs/fleet.h index 93bdee7..2ae03e7 100644 --- a/bs/fleet.h +++ b/bs/fleet.h @@ -179,7 +179,7 @@ public: * and are staying long enough. * \todo add the stays part as a integrated part of each fleet. */ - std::vector calculateSide(std::vector fleets, int stays = 0, int tick = 0); + std::vector calculateSide(std::vector fleets, int tick = 0); /** Kill some ships of the specified type in the current fleet. * \param unittype the name of the unit to kill @@ -227,6 +227,13 @@ 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. @@ -255,13 +262,28 @@ public: * very similar stuff in both the take* functions. * \sa takeShoot */ - void takeEMP(std::string unittype, int number); + void takeEMP(std::string unittype, int number, std::map& hitunits); + + 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. */ void printFleet(); + void resetTicks(); + + int freePodGuns(int tick = 0); + + int usedPodGuns(int tick = 0) const; + + void usePodGuns(int tick = 0, int guns = 1); + + std::map findTargets(std::string targetClass,int& total, int attackerType = 0); + //static functions // /** This function is used to set the different races used. @@ -288,13 +310,15 @@ public: protected: - std::string m_sName; - std::string m_sRace; - int m_iETA; - FleetList m_Fleet; - FleetList m_BlockedFleet; - ResourceList m_Resources; - ArmorList m_Armor; + std::string m_sName; + std::string m_sRace; + int m_iETA; + FleetList m_Fleet; + FleetList m_BlockedFleet; + ResourceList m_Resources; + ArmorList m_Armor; + int m_iStays; + std::vector m_UsedPodGuns;