summaryrefslogtreecommitdiff
path: root/src/net/messageout.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-05 22:31:07 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-05 22:31:07 +0300
commit135fa01ee301fd878c93444999a625f64ccf76c1 (patch)
tree61c3bc0c3778268b64e1471aea4a2d0ead3962ad /src/net/messageout.h
parentca8cf76ea713b75db3b573f30c023f7637e9cdf3 (diff)
downloadmv-135fa01ee301fd878c93444999a625f64ccf76c1.tar.gz
mv-135fa01ee301fd878c93444999a625f64ccf76c1.tar.bz2
mv-135fa01ee301fd878c93444999a625f64ccf76c1.tar.xz
mv-135fa01ee301fd878c93444999a625f64ccf76c1.zip
Moved same methods from messageout into one file.
Diffstat (limited to 'src/net/messageout.h')
-rw-r--r--src/net/messageout.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/net/messageout.h b/src/net/messageout.h
index 3c171e077..9cf9b7e3e 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -54,45 +54,56 @@ class MessageOut notfinal
const char *const str);
/**< Writes a short. */
- virtual void writeInt16(const int16_t value,
- const char *const str) = 0;
+ void writeInt16(const int16_t value,
+ const char *const str);
/**< Writes a long. */
- virtual void writeInt32(const int32_t value,
- const char *const str) = 0;
+ void writeInt32(const int32_t value,
+ const char *const str);
- virtual void writeBeingId(const BeingId value,
- const char *const str) = 0;
+ void writeInt64(const int64_t value,
+ const char *const str);
+
+ void writeBeingId(const BeingId value,
+ const char *const str);
+
+ void writeCoordinates(const uint16_t x,
+ const uint16_t y,
+ unsigned char direction,
+ const char *const str);
/**
* Writes a string. If a fixed length is not given (-1), it is stored
* as a short at the start of the string.
*/
- virtual void writeString(const std::string &string,
- int length,
- const char *const str);
+ void writeString(const std::string &string,
+ int length,
+ const char *const str);
/**
* Writes a string. If a fixed length is not given (-1), it is stored
* as a short at the start of the string.
*/
- virtual void writeStringNoLog(const std::string &string,
- int length,
- const char *const str);
+ void writeStringNoLog(const std::string &string,
+ int length,
+ const char *const str);
/**
* Returns the content of the message.
*/
- virtual const char *getData() const A_WARN_UNUSED;
+ const char *getData() const A_WARN_UNUSED;
/**
* Returns the length of the data.
*/
- virtual unsigned int getDataSize() const A_WARN_UNUSED;
+ unsigned int getDataSize() const A_WARN_UNUSED;
virtual ~MessageOut()
{ }
+ void resetPos()
+ { mPos = 0; }
+
static unsigned char toServerDirection(unsigned char direction)
A_CONST;