openmw-tes3coop/apps/openmw/mwmp/processors/ActorProcessor.hpp
2017-06-27 15:25:30 +08:00

34 lines
892 B
C++

//
// Created by koncord on 18.04.17.
//
#ifndef OPENMW_ACTORPROCESSOR_HPP
#define OPENMW_ACTORPROCESSOR_HPP
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <unordered_map>
#include "../WorldEvent.hpp"
#include "../ActorList.hpp"
#include "BaseClientPacketProcessor.hpp"
namespace mwmp
{
class ActorProcessor : public BaseClientPacketProcessor
{
public:
virtual void Do(ActorPacket &packet, ActorList &actorList) = 0;
static bool Process(RakNet::Packet &packet, ActorList &actorList);
static void AddProcessor(ActorProcessor *processor);
typedef std::unordered_map<unsigned char, std::unique_ptr<ActorProcessor> > processors_t;
private:
static processors_t processors;
};
}
#endif //OPENMW_ACTORPROCESSOR_HPP