00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #ifndef Packet_h
00031 #define Packet_h
00032
00033
00034
00035 #include "CargoHolder.h"
00036 #include "Planet.h"
00037
00043 class Packet : public CargoHolder
00044 {
00045 public:
00046 Packet() : mSpeed(0), mDriverSpeed(0), mDestination(NULL), mFirstYear(false) { SetID(0); }
00047 Packet(const CargoHolder &source, long speed, long driverSpeed, Planet * destination);
00048 virtual bool ParseNode(const TiXmlNode * node);
00049 virtual TiXmlNode * WriteNode(TiXmlNode * node, const Player * viewer) const;
00050
00051 bool IsEmpty() const { return mMaxSize == 0; }
00052 virtual long GetCargoCapacity() const { return mMaxSize; }
00053 virtual long GetCloak(const Player *, bool) const;
00054 virtual double GetMaxTachyon() const { return 0.0; }
00055 virtual long GetScanPen() const;
00056 virtual long GetScanSpace() const;
00057 virtual void SetCanLoadBy(const Player *) {}
00058 virtual bool CanLoadBy(const Player *) const { return true; }
00059
00060 long GetSpeed() const { return mSpeed; }
00061 long GetDriverSpeed() const { return mDriverSpeed; }
00062 Planet * GetDestination() { return mDestination; }
00063 bool Move(bool FirstYear);
00064 ~Packet();
00065
00066 private:
00067 void Collide();
00068 void Decay(long distance);
00069 long mSpeed;
00070 long mDriverSpeed;
00071 long mMaxSize;
00072 Planet * mDestination;
00073 bool mFirstYear;
00074 };
00075
00076 #endif // Packet_h