X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Ffleet.h;h=10517318708288c545380d3a96b82f5783cbc6c2;hb=86211c03ec3dba0fc308b5ca7b0a7b1550c2896f;hp=f1d96affc4fb1264464f704c55db3262eb5b4646;hpb=3ae63f013b2ac281d17acec43bc054a132861d35;p=hbs.git diff --git a/bs/fleet.h b/bs/fleet.h index f1d96af..1051731 100644 --- a/bs/fleet.h +++ b/bs/fleet.h @@ -28,6 +28,8 @@ typedef std::map > FleetList; typedef std::map UnitList; typedef std::map > RaceList; +typedef std::map > ResourceList; +typedef std::map ArmorList; //! An abstraction of a fleet and the engine for the battle simulation. /**This class and it's derivates is the engine for the whole battlesystem. * One of the few parts that I plan make fully portable. @@ -87,8 +89,10 @@ public: */ unsigned score(int tick = 0) const; - void setFleet(std::string unittype, int number); + void setFleet(std::string unittype, int number, int tick = 0); int fleet(std::string unittype, int tick = 0); + + int freeFleet(std:: string unittype, int tick = 0); static void setRaces(RaceList& races); static void setUnits(UnitList& units); @@ -100,9 +104,22 @@ public: void distributeLossesGains(std::vector fleets, int tick = 0); + void distributeCappedRoids(std::vector fleets, int tick = 0); + std::vector calculateSide(std::vector fleets, int stays = 0, int tick = 0); + void killFleet(std::string unittype, int number, int tick = 0); + void blockFleet(std::string unittype, int number, int tick = 0); + + void setResource(std::string type, int number, int tick = 0); + void addResource(std::string type, int number, int tick = 0); + int resource(std::string type, int tick = 0)const; + + void takeShoot(std::string unittype, int number, std::map& hitunits); + void takeEMP(std::string unittype, int number); + + void printFleet(); protected: @@ -110,6 +127,11 @@ protected: std::string m_sRace; int m_iETA; FleetList m_Fleet; + FleetList m_BlockedFleet; + ResourceList m_Resources; + ArmorList m_Armor; + + static UnitList s_Units; static RaceList s_Races;