Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Packet.h
- class Packet
- {
- private:
- Packet& operator=(const Packet&);
- public:
- struct PacketInitException : std::runtime_error
- {
- PacketInitException(const std::string& msg) : runtime_error(msg)
- {}
- };
- Packet();
- virtual ~Packet();
- virtual Packet* clone() const = 0;
- virtual void handle() = 0;
- virtual PacketFactory::PacketIds getId() const = 0;
- virtual void serialize(Uint8 *data) const;
- static Packet* createPacket(Uint8 *data);
- virtual void deserialize(Uint8 *data);
- virtual int getPacketSize() const;
- Uint16 packetId;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement