1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwworld/player.hpp

100 lines
2.6 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_PLAYER_H
#define GAME_MWWORLD_PLAYER_H
#include "../mwworld/refdata.hpp"
2013-04-04 11:23:17 +02:00
#include "../mwworld/livecellref.hpp"
#include "../mwmechanics/drawstate.hpp"
#include <OgreVector3.h>
2013-04-04 11:23:17 +02:00
namespace ESM
{
struct NPC;
class ESMWriter;
class ESMReader;
2013-04-04 11:23:17 +02:00
}
namespace MWBase
{
class World;
2013-04-04 11:23:17 +02:00
class Ptr;
}
namespace MWWorld
{
class CellStore;
/// \brief NPC object representing the player and additional player data
class Player
2010-07-26 12:59:50 +02:00
{
2012-11-08 01:36:43 +04:00
LiveCellRef<ESM::NPC> mPlayer;
MWWorld::CellStore *mCellStore;
2012-11-08 18:50:18 +04:00
std::string mSign;
2012-11-08 01:36:43 +04:00
Ogre::Vector3 mLastKnownExteriorPosition;
2014-01-01 17:06:21 +01:00
ESM::Position mMarkedPosition;
// If no position was marked, this is NULL
CellStore* mMarkedCell;
2012-11-08 01:36:43 +04:00
bool mAutoMove;
int mForwardBackward;
bool mTeleported;
2011-01-06 10:07:01 +01:00
public:
2010-06-22 10:15:22 +02:00
Player(const ESM::NPC *player, const MWBase::World& world);
2014-01-01 17:06:21 +01: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 17:54:18 +02:00
void set (const ESM::NPC *player);
2013-04-04 11:23:17 +02:00
void setCell (MWWorld::CellStore *cellStore);
2013-04-04 11:23:17 +02:00
MWWorld::Ptr getPlayer();
2013-04-04 11:23:17 +02:00
void setBirthSign(const std::string &sign);
2012-11-08 18:50:18 +04:00
2013-04-04 11:23:17 +02:00
const std::string &getBirthSign() const;
2012-11-08 18:50:18 +04:00
2012-07-07 20:53:19 +02:00
void setDrawState (MWMechanics::DrawState_ state);
2013-04-04 11:23:17 +02:00
bool getAutoMove() const;
2011-01-18 15:20:36 +01:00
2012-07-07 20:53:19 +02:00
MWMechanics::DrawState_ getDrawState(); /// \todo constness
2011-02-03 12:16:59 +01:00
void setAutoMove (bool enable);
2011-01-18 15:20:36 +01:00
2011-02-03 12:16:59 +01:00
void setLeftRight (int value);
2011-01-18 15:20:36 +01:00
2011-02-03 12:16:59 +01:00
void setForwardBackward (int value);
void setUpDown(int value);
2011-01-18 15:20:36 +01:00
2013-02-06 17:51:47 -08:00
void setRunState(bool run);
2013-03-06 16:58:56 +01: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 15:34:32 +01:00
void clear();
void write (ESM::ESMWriter& writer) const;
bool readRecord (ESM::ESMReader& reader, int32_t type);
2011-01-18 15:20:36 +01:00
};
}
#endif