SHARE
TWEET

yuriks

a guest Dec 2nd, 2008 812 Never
  1. // Packet.h
  2.  
  3. class Packet
  4. {
  5. private:
  6.         Packet& operator=(const Packet&);
  7. public:
  8.         struct PacketInitException : std::runtime_error
  9.         {
  10.                 PacketInitException(const std::string& msg) : runtime_error(msg)
  11.                 {}
  12.         };
  13.  
  14.         Packet();
  15.         virtual ~Packet();
  16.  
  17.         virtual Packet* clone() const = 0;
  18.  
  19.         virtual void handle() = 0;
  20.         virtual PacketFactory::PacketIds getId() const = 0;
  21.  
  22.         virtual void serialize(Uint8 *data) const;
  23.         static Packet* createPacket(Uint8 *data);
  24.         virtual void deserialize(Uint8 *data);
  25.         virtual int getPacketSize() const;
  26.  
  27.  
  28.         Uint16 packetId;
  29. };
RAW Paste Data
Top