From 48a59cf9e90283b61a1b3d3e259c73fd501c2778 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 1 Apr 2017 02:33:03 +0800 Subject: [PATCH] [General] Add new class BasePacketProcessor --- .../openmw-mp/Base/BasePacketProcessor.hpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 components/openmw-mp/Base/BasePacketProcessor.hpp diff --git a/components/openmw-mp/Base/BasePacketProcessor.hpp b/components/openmw-mp/Base/BasePacketProcessor.hpp new file mode 100644 index 000000000..e2cb51637 --- /dev/null +++ b/components/openmw-mp/Base/BasePacketProcessor.hpp @@ -0,0 +1,36 @@ +// +// Created by koncord on 31.03.17. +// + +#ifndef OPENMW_BASEPACKETPROCESSOR_HPP +#define OPENMW_BASEPACKETPROCESSOR_HPP + +#include + +#define BPP_INIT(packet_id) packetID = packet_id; strPacketID = #packet_id; className = typeid(this).name(); + +class BasePacketProcessor +{ +public: + unsigned char GetPacketID() + { + return packetID; + } + std::string GetNameOfID() + { + return strPacketID; + } + + std::string GetClassName() + { + return className; + } + +protected: + unsigned char packetID; + std::string strPacketID; + std::string className; +}; + + +#endif //OPENMW_BASEPACKETPROCESSOR_HPP