[Client] Create Worldstate class that inherits BaseWorldstate

pull/441/head
David Cernat 7 years ago
parent f7a084c824
commit e8ec031a81

@ -1,7 +1,3 @@
//
// Created by koncord on 04.01.16.
//
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
#include <string> #include <string>
@ -477,7 +473,7 @@ ObjectList *Networking::getObjectList()
return &objectList; return &objectList;
} }
BaseWorldstate *Networking::getWorldstate() Worldstate *Networking::getWorldstate()
{ {
return &worldstate; return &worldstate;
} }

@ -1,7 +1,3 @@
//
// Created by koncord on 04.01.16.
//
#ifndef OPENMW_NETWORKING_HPP #ifndef OPENMW_NETWORKING_HPP
#define OPENMW_NETWORKING_HPP #define OPENMW_NETWORKING_HPP
@ -9,8 +5,6 @@
#include <BitStream.h> #include <BitStream.h>
#include <string> #include <string>
#include "ActorList.hpp"
#include "ObjectList.hpp"
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp> #include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
@ -20,6 +14,10 @@
#include <components/files/collections.hpp> #include <components/files/collections.hpp>
#include "ActorList.hpp"
#include "ObjectList.hpp"
#include "Worldstate.hpp"
namespace mwmp namespace mwmp
{ {
class LocalPlayer; class LocalPlayer;
@ -47,7 +45,7 @@ namespace mwmp
LocalPlayer *getLocalPlayer(); LocalPlayer *getLocalPlayer();
ActorList *getActorList(); ActorList *getActorList();
ObjectList *getObjectList(); ObjectList *getObjectList();
BaseWorldstate *getWorldstate(); Worldstate *getWorldstate();
private: private:
bool connected; bool connected;
@ -62,7 +60,7 @@ namespace mwmp
ActorList actorList; ActorList actorList;
ObjectList objectList; ObjectList objectList;
BaseWorldstate worldstate; Worldstate worldstate;
void receiveMessage(RakNet::Packet *packet); void receiveMessage(RakNet::Packet *packet);

@ -0,0 +1,21 @@
#include "Worldstate.hpp"
#include "Main.hpp"
#include "Networking.hpp"
using namespace mwmp;
using namespace std;
Worldstate::Worldstate()
{
}
Worldstate::~Worldstate()
{
}
Networking *Worldstate::getNetworking()
{
return mwmp::Main::get().getNetworking();
}

@ -0,0 +1,22 @@
#ifndef OPENMW_WORLDSTATE_HPP
#define OPENMW_WORLDSTATE_HPP
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
namespace mwmp
{
class Networking;
class Worldstate : public BaseWorldstate
{
public:
Worldstate();
virtual ~Worldstate();
private:
Networking *getNetworking();
};
}
#endif //OPENMW_WORLDSTATE_HPP
Loading…
Cancel
Save