[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 <iostream>
#include <string>
@ -477,7 +473,7 @@ ObjectList *Networking::getObjectList()
return &objectList;
}
BaseWorldstate *Networking::getWorldstate()
Worldstate *Networking::getWorldstate()
{
return &worldstate;
}

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