1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 06:49:55 +00:00
openmw-tes3mp/apps/openmw/mwworld/player.hpp

113 lines
3.2 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_PLAYER_H
#define GAME_MWWORLD_PLAYER_H
#include "../mwworld/refdata.hpp"
2013-04-04 09:23:17 +00:00
#include "../mwworld/livecellref.hpp"
#include "../mwmechanics/drawstate.hpp"
#include <OgreVector3.h>
2013-04-04 09:23:17 +00:00
namespace ESM
{
struct NPC;
class ESMWriter;
class ESMReader;
2013-04-04 09:23:17 +00:00
}
namespace MWBase
{
class World;
2013-04-04 09:23:17 +00:00
class Ptr;
}
namespace Loading
{
class Listener;
}
namespace MWWorld
{
class CellStore;
/// \brief NPC object representing the player and additional player data
class Player
2010-07-26 10:59:50 +00:00
{
2012-11-07 21:36:43 +00:00
LiveCellRef<ESM::NPC> mPlayer;
MWWorld::CellStore *mCellStore;
2012-11-08 14:50:18 +00:00
std::string mSign;
2012-11-07 21:36:43 +00:00
Ogre::Vector3 mLastKnownExteriorPosition;
2014-01-01 16:06:21 +00:00
ESM::Position mMarkedPosition;
// If no position was marked, this is NULL
CellStore* mMarkedCell;
2012-11-07 21:36:43 +00:00
bool mAutoMove;
int mForwardBackward;
bool mTeleported;
int mCurrentCrimeId; // the id assigned witnesses
int mPayedCrimeId; // the last id payed off (0 bounty)
2011-01-06 09:07:01 +00:00
public:
2010-06-22 08:15:22 +00:00
Player(const ESM::NPC *player, const MWBase::World& world);
2014-01-01 16:06:21 +00:00
// For mark/recall magic effects
void markPosition (CellStore* markedCell, ESM::Position markedPosition);
void getMarkedPosition (CellStore*& markedCell, ESM::Position& markedPosition) const;
/// Interiors can not always be mapped to a world position. However
/// world position is still required for divine / almsivi magic effects
/// and the player arrow on the global map.
/// TODO: This should be stored in the savegame, too.
void setLastKnownExteriorPosition (const Ogre::Vector3& position) { mLastKnownExteriorPosition = position; }
Ogre::Vector3 getLastKnownExteriorPosition() const { return mLastKnownExteriorPosition; }
2013-05-15 15:54:18 +00:00
void set (const ESM::NPC *player);
2013-04-04 09:23:17 +00:00
void setCell (MWWorld::CellStore *cellStore);
2013-04-04 09:23:17 +00:00
MWWorld::Ptr getPlayer();
2013-04-04 09:23:17 +00:00
void setBirthSign(const std::string &sign);
const std::string &getBirthSign() const;
2012-11-08 14:50:18 +00:00
2012-07-07 18:53:19 +00:00
void setDrawState (MWMechanics::DrawState_ state);
MWMechanics::DrawState_ getDrawState(); /// \todo constness
bool getAutoMove() const;
2011-02-03 11:16:59 +00:00
void setAutoMove (bool enable);
2011-01-18 14:20:36 +00:00
2011-02-03 11:16:59 +00:00
void setLeftRight (int value);
2011-01-18 14:20:36 +00:00
2011-02-03 11:16:59 +00:00
void setForwardBackward (int value);
void setUpDown(int value);
2011-01-18 14:20:36 +00:00
2013-02-07 01:51:47 +00:00
void setRunState(bool run);
2013-03-06 15:58:56 +00:00
void setSneak(bool sneak);
void yaw(float yaw);
void pitch(float pitch);
void roll(float roll);
bool wasTeleported() const;
void setTeleported(bool teleported);
2014-01-11 14:34:32 +00:00
///Checks all actors to see if anyone has an aipackage against you
bool isInCombat();
2014-01-11 14:34:32 +00:00
void clear();
void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
bool readRecord (ESM::ESMReader& reader, int32_t type);
int getNewCrimeId(); // get new id for witnesses
void recordCrimeId(); // record the payed crime id when bounty is 0
int getCrimeId() const; // get the last payed crime id
2011-01-18 14:20:36 +00:00
};
}
#endif