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

TempFleet.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan
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 Contact:
00023 Email Elliott at 9jm0tjj02@sneakemail.com
00024 */
00025 
00030 #if !defined(TempFleet_h)
00031 #define TempFleet_h
00032 
00033 #include <string>
00034 #include <deque>
00035 using namespace std;
00036 
00037 class Player;
00038 
00039 #include "CargoHolder.h"
00040 
00044 class TempFleet : public CargoHolder {
00045 public:
00046         TempFleet(int fleetID, Player * owner);
00047         TempFleet(const CargoHolder * ch, CargoHolder * ch2) : CargoHolder(*ch), mCargoHolder(ch2) { assert(ch2 == NULL || ch->IsWith(*ch2)); }
00048         virtual ~TempFleet();
00049 
00050         void AddChaser(unsigned long p, unsigned long f);
00051 
00052         virtual long GetContain(long ct) const  { return mCargoHolder && mCargoHolder->CanLoadBy(GetOwner()) && ct != POPULATION ? mCargoHolder->GetContain(ct) : 0; }
00053         virtual long GetCargoCapacity() const   { return mCargoHolder ? mCargoHolder->GetCargoCapacity() : -1; }
00054         virtual bool CanLoadBy(const Player * p) const          {  return mCargoHolder ? mCargoHolder->CanLoadBy(p) : true;  }
00055 
00056         // virtual functions, they should never be called
00057         virtual long SeenBy(const Player *) const                       { assert(false); return 0; }
00058         virtual long SeenBy(unsigned long) const                        { assert(false); return 0; }
00059         virtual void SetSeenBy(long, long)                                      { assert(false); }
00060         virtual long GetCloak(const Player *, bool) const       { assert(false); return 0; }
00061         virtual double GetMaxTachyon() const                            { assert(false); return 0.0; }
00062         virtual long GetScanPen() const                                         { assert(false); return -1; }
00063         virtual long GetScanSpace() const                                       { assert(false); return -1; }
00064         virtual void ResetSeen()                                                        { assert(false); }
00065         virtual bool CanStealShip() const                                       { assert(false); return false; }
00066         virtual bool CanStealPlanet() const                                     { assert(false); return false; }
00067         virtual void SetCanLoadBy(const Player *)                       { assert(false); }
00068 
00069         CargoHolder * GetRealCH()       { return mCargoHolder; }
00070         long GetFuel() const            { return mFuel; }
00071         void AdjustFuel(long fuel)      { mFuel += fuel; }
00072 
00073 private:
00074 //      void AddChaser(const deque<Chaser> &w2);
00075 //      deque<Chaser> mChasers;
00076         CargoHolder * mCargoHolder;
00077         long mFuel;
00078 };
00079 
00080 #endif // !defined(TempFleet_h)

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