Advertisement
Guest User

yuriks

a guest
Dec 2nd, 2008
1,602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  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. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement