[Client] Create LocalEvent class and use it instead of WorldEvent
parent
ee86c9161d
commit
624b85347a
@ -0,0 +1,33 @@
|
||||
#include "LocalEvent.hpp"
|
||||
#include "Networking.hpp"
|
||||
#include "Main.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
using namespace std;
|
||||
|
||||
LocalEvent::LocalEvent(RakNet::RakNetGUID guid)
|
||||
{
|
||||
this->guid = guid;
|
||||
}
|
||||
|
||||
LocalEvent::~LocalEvent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Networking *LocalEvent::getNetworking()
|
||||
{
|
||||
return mwmp::Main::get().getNetworking();
|
||||
}
|
||||
|
||||
void LocalEvent::addCellRef(MWWorld::CellRef worldCellRef)
|
||||
{
|
||||
cellRef.mRefID = worldCellRef.getRefId();
|
||||
cellRef.mRefNum = worldCellRef.getRefNum();
|
||||
cellRef.mGoldValue = worldCellRef.getGoldValue();
|
||||
}
|
||||
|
||||
void LocalEvent::addRefId(std::string refId)
|
||||
{
|
||||
cellRef.mRefID = refId;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_LOCALEVENT_HPP
|
||||
#define OPENMW_LOCALEVENT_HPP
|
||||
|
||||
#include <components/openmw-mp/Base/WorldEvent.hpp>
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
#include <RakNetTypes.h>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class Networking;
|
||||
class LocalEvent : public WorldEvent
|
||||
{
|
||||
public:
|
||||
|
||||
LocalEvent(RakNet::RakNetGUID guid);
|
||||
virtual ~LocalEvent();
|
||||
|
||||
void addCellRef(MWWorld::CellRef worldCellRef);
|
||||
void addRefId(std::string refId);
|
||||
|
||||
private:
|
||||
Networking *getNetworking();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_LOCALEVENT_HPP
|
Loading…
Reference in New Issue