diff options
Diffstat (limited to 'src/net/messageout.h')
-rw-r--r-- | src/net/messageout.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/net/messageout.h b/src/net/messageout.h index b2ee506e..f6468adb 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -27,7 +27,7 @@ #include <iosfwd> #include <SDL_types.h> -class Packet; +class Network; /** * Used for building an outgoing message. @@ -42,12 +42,7 @@ class MessageOut /** * Constructor. */ - MessageOut(); - - /** - * Destructor. - */ - ~MessageOut(); + MessageOut(Network *network); void writeInt8(Sint8 value); /**< Writes a byte. */ void writeInt16(Sint16 value); /**< Writes a short. */ @@ -59,24 +54,9 @@ class MessageOut */ void writeString(const std::string &string, int length = -1); - /** - * Returns an instance of Packet derived from the written data. Use for - * sending the packet. No more writing to the packet may be done after - * a call to this method. - */ - const Packet *getPacket(); - private: - /** - * Expand the packet data to be able to hold more data. - * - * NOTE: For performance enhancements this method could allocate extra - * memory in advance instead of expanding size every time more data is - * added. - */ - void expand(size_t size); + Network *mNetwork; - Packet *mPacket; /**< Created packet. */ char *mData; /**< Data building up. */ unsigned int mDataSize; /**< Size of data. */ unsigned int mPos; /**< Position in the data. */ |