Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List

Bombing.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2003 - 2005 Grant Speelman, Elliott Kleinrock
00003 
00004 This file is part of FreeStars, a free clone of the Stars! game.
00005 
00006 FreeStars is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 FreeStars is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with FreeStars; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 The full GPL Copyright notice should be in the file COPYING.txt
00021 
00022 */
00023 
00029 #ifndef BOMBING_H
00030 #define BOMBING_H
00031 
00037 class Bombing : public Location
00038 {
00039 public:
00040     Bombing(const Location & loc);
00041     ~Bombing();
00042 
00043     void SetPlanet(Planet* targetPlanet);
00044         void AddFleets();
00045         void AddTerraFleet(Fleet* f){mTerraBombingFleets.push_back(f);}
00046         void AddSmartFleet(Fleet* f){mSmartBombingFleets.push_back(f);}
00047         void AddNormalFleet(Fleet* f){mNormalBombingFleets.push_back(f);}
00048         void Resolve();
00049         
00050 private:
00051         void SendMessages(){SendSmartMessages();SendTerraMessages();SendNormalMessages();}
00052         void SendSmartMessages();
00053         void SendTerraMessages();
00054         void SendNormalMessages();
00055         void DoPopulationLosses(const double& normal_killper, const long& normal_minimum , const double& smart_killper);
00056         void DoInstallationLosses(const long& installation_loss);
00057         void DoTerraTransforming();
00058         double GetSmartKillper() const;
00059 
00060         Planet* mTargetPlanet;  // the planet targeted for bombing
00061         
00062         deque<Player*> mSmartBombingPlayers;    // the players that take part in smart bombing
00063         deque<Player*> mNormalBombingPlayers;   // the players that take part in normal bombing
00064         deque<Player*> mTerraBombingPlayers;    // the players that take part in terra bombing
00065         
00066         deque<Fleet*> mSmartBombingFleets;      // the fleets that take part in smart bombing
00067         deque<Fleet*> mNormalBombingFleets;     // the fleets that take part in normal bombing
00068         deque<Fleet*> mTerraBombingFleets;      // the fleets that take part in terra bombing
00069         
00070         
00071         long mPopulationLoss;   // the amount of people killed
00072         long mDefensesLoss, mMinesLoss, mFactoriesLoss; // the amount of installtions destroyed
00073         bool mKilledAll;        // if All the population was killed
00074         double mNormalPercentageStopped; // Percentage bombs stopped
00075         double mSmartPercentageStopped; // Percentage smart bombs stopped
00076 
00077 };
00078 
00079 
00080 #endif

Generated on Mon Aug 8 21:33:42 2005 for Freestars by  doxygen 1.4.2-20050421