1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 07:49:56 +00:00
openmw-tes3mp/apps/openmw/mwmp/DedicatedPlayer.hpp

73 lines
1.8 KiB
C++
Raw Normal View History

//
// Created by koncord on 02.01.16.
//
#ifndef OPENMW_PLAYER_HPP
#define OPENMW_PLAYER_HPP
#include <components/esm/loadnpc.hpp>
2016-11-17 15:16:25 +00:00
#include "../mwworld/manualref.hpp"
#include <map>
2016-11-17 15:16:25 +00:00
#include "../mwmechanics/aisequence.hpp"
#include <RakNetTypes.h>
#include <components/openmw-mp/Base/BasePlayer.hpp>
2016-10-22 09:06:26 +00:00
#include <components/esm/custommarkerstate.hpp>
2016-11-12 11:39:04 +00:00
namespace MWMechanics
{
class Actor;
}
namespace mwmp
{
struct DedicatedPlayer;
class Players
{
public:
static DedicatedPlayer *newPlayer(RakNet::RakNetGUID guid);
static void createPlayer(RakNet::RakNetGUID guid);
static void disconnectPlayer(RakNet::RakNetGUID guid);
static void cleanUp();
static DedicatedPlayer *getPlayer(RakNet::RakNetGUID guid);
static DedicatedPlayer *getPlayer(const MWWorld::Ptr &ptr);
static void update(float dt);
private:
static std::map<RakNet::RakNetGUID, DedicatedPlayer *> players;
};
class DedicatedPlayer : public BasePlayer
{
friend class Players;
public:
MWWorld::Ptr getPtr();
MWWorld::Ptr getLiveCellPtr();
MWWorld::ManualRef* getRef();
void move(float dt);
void updateDrawState();
void updateEquipment();
void updateCell();
2016-10-22 09:06:26 +00:00
void updateMarker();
void removeMarker();
void setMarkerState(bool state);
2016-11-12 11:39:04 +00:00
void updateActor(MWMechanics::Actor *actor);
private:
DedicatedPlayer(RakNet::RakNetGUID guid);
virtual ~DedicatedPlayer();
void updatePtr(MWWorld::Ptr newPtr);
const std::string getAnim();
int state;
MWWorld::ManualRef* reference;
MWWorld::Ptr ptr;
2016-10-22 09:06:26 +00:00
ESM::CustomMarker marker;
bool markerEnabled;
};
}
#endif //OPENMW_PLAYER_HPP