mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-27 11:39:39 +00:00
[Client] Create Worldstate class that inherits BaseWorldstate
This commit is contained in:
parent
f7a084c824
commit
e8ec031a81
4 changed files with 50 additions and 13 deletions
|
@ -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);
|
||||
|
||||
|
|
21
apps/openmw/mwmp/Worldstate.cpp
Normal file
21
apps/openmw/mwmp/Worldstate.cpp
Normal file
|
@ -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();
|
||||
}
|
22
apps/openmw/mwmp/Worldstate.hpp
Normal file
22
apps/openmw/mwmp/Worldstate.hpp
Normal file
|
@ -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…
Reference in a new issue