#ifndef PAYLOAD_H #define PAYLOAD_H #include #include namespace Payload { namespace Types { //! Payload types. enum Type { Undefined, Hello, Login, LoginResponse, LobbyStatus, LobbyAction, GameStart, Ready, RoundStart, RoundState, RoundAction, RoundEnd, GameEnd }; } using Types::Type; class Base { protected: friend class Message; virtual std::pair serialize() = 0; Base(Type t) : type(t) {} public: const Type type; }; class Hello : public Base { protected: virtual std::pair serialize(); public: Hello() : Base(Types::Hello) {} }; }; #endif