From e8ec031a81b8315b23d36babc04fe1575ca25196 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 27 May 2018 15:57:47 +0300 Subject: [PATCH] [Client] Create Worldstate class that inherits BaseWorldstate --- apps/openmw/mwmp/Networking.cpp | 6 +----- apps/openmw/mwmp/Networking.hpp | 14 ++++++-------- apps/openmw/mwmp/Worldstate.cpp | 21 +++++++++++++++++++++ apps/openmw/mwmp/Worldstate.hpp | 22 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 apps/openmw/mwmp/Worldstate.cpp create mode 100644 apps/openmw/mwmp/Worldstate.hpp diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 0d13ce95f..b5779cc21 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 04.01.16. -// - #include #include #include @@ -477,7 +473,7 @@ ObjectList *Networking::getObjectList() return &objectList; } -BaseWorldstate *Networking::getWorldstate() +Worldstate *Networking::getWorldstate() { return &worldstate; } diff --git a/apps/openmw/mwmp/Networking.hpp b/apps/openmw/mwmp/Networking.hpp index fa8a83be8..0f0ce93ec 100644 --- a/apps/openmw/mwmp/Networking.hpp +++ b/apps/openmw/mwmp/Networking.hpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 04.01.16. -// - #ifndef OPENMW_NETWORKING_HPP #define OPENMW_NETWORKING_HPP @@ -9,8 +5,6 @@ #include #include -#include "ActorList.hpp" -#include "ObjectList.hpp" #include #include @@ -20,6 +14,10 @@ #include +#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); diff --git a/apps/openmw/mwmp/Worldstate.cpp b/apps/openmw/mwmp/Worldstate.cpp new file mode 100644 index 000000000..19b171417 --- /dev/null +++ b/apps/openmw/mwmp/Worldstate.cpp @@ -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(); +} diff --git a/apps/openmw/mwmp/Worldstate.hpp b/apps/openmw/mwmp/Worldstate.hpp new file mode 100644 index 000000000..97b89375d --- /dev/null +++ b/apps/openmw/mwmp/Worldstate.hpp @@ -0,0 +1,22 @@ +#ifndef OPENMW_WORLDSTATE_HPP +#define OPENMW_WORLDSTATE_HPP + +#include + +namespace mwmp +{ + class Networking; + class Worldstate : public BaseWorldstate + { + public: + + Worldstate(); + virtual ~Worldstate(); + + private: + Networking *getNetworking(); + + }; +} + +#endif //OPENMW_WORLDSTATE_HPP