| 1 | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ |
| 2 | /* If you are missing that file, acquire a complete release at teeworlds.com. */ |
| 3 | #ifndef ENGINE_MESSAGE_H |
| 4 | #define ENGINE_MESSAGE_H |
| 5 | |
| 6 | #include <engine/shared/packer.h> |
| 7 | #include <engine/shared/uuid_manager.h> |
| 8 | |
| 9 | class CMsgPacker : public CPacker |
| 10 | { |
| 11 | public: |
| 12 | int m_MsgId; |
| 13 | bool m_System; |
| 14 | bool m_NoTranslate; |
| 15 | CMsgPacker(int Type, bool System = false, bool NoTranslate = false) : |
| 16 | m_MsgId(Type), m_System(System), m_NoTranslate(NoTranslate) |
| 17 | { |
| 18 | Reset(); |
| 19 | } |
| 20 | |
| 21 | template<typename T> |
| 22 | CMsgPacker(const T *, bool System = false, bool NoTranslate = false) : |
| 23 | CMsgPacker(T::ms_MsgId, System, NoTranslate) |
| 24 | { |
| 25 | } |
| 26 | }; |
| 27 | |
| 28 | #endif |
| 29 | |