OpenMW
apps/openmw/mwworld/player.hpp
Go to the documentation of this file.
00001 #ifndef GAME_MWWORLD_PLAYER_H
00002 #define GAME_MWWORLD_PLAYER_H
00003 
00004 #include "../mwworld/refdata.hpp"
00005 #include "../mwworld/livecellref.hpp"
00006 
00007 #include "../mwmechanics/drawstate.hpp"
00008 
00009 #include <OgreVector3.h>
00010 
00011 namespace ESM
00012 {
00013     struct NPC;
00014 }
00015 
00016 namespace MWBase
00017 {
00018     class World;
00019     class Ptr;
00020 }
00021 
00022 namespace MWWorld
00023 {
00024     class CellStore;
00025 
00027     class Player
00028     {
00029         LiveCellRef<ESM::NPC>   mPlayer;
00030         MWWorld::CellStore      *mCellStore;
00031         std::string             mSign;
00032 
00033         Ogre::Vector3 mLastKnownExteriorPosition;
00034 
00035         ESM::Position           mMarkedPosition;
00036         // If no position was marked, this is NULL
00037         CellStore*              mMarkedCell;
00038 
00039         bool                    mAutoMove;
00040         int                     mForwardBackward;
00041         bool                    mTeleported;
00042     public:
00043 
00044         Player(const ESM::NPC *player, const MWBase::World& world);
00045 
00046         // For mark/recall magic effects
00047         void markPosition (CellStore* markedCell, ESM::Position markedPosition);
00048         void getMarkedPosition (CellStore*& markedCell, ESM::Position& markedPosition) const;
00049 
00054         void setLastKnownExteriorPosition (const Ogre::Vector3& position) { mLastKnownExteriorPosition = position; }
00055         Ogre::Vector3 getLastKnownExteriorPosition() const { return mLastKnownExteriorPosition; }
00056 
00057         void set (const ESM::NPC *player);
00058 
00059         void setCell (MWWorld::CellStore *cellStore);
00060 
00061         MWWorld::Ptr getPlayer();
00062 
00063         void setBirthSign(const std::string &sign);
00064 
00065         const std::string &getBirthSign() const;
00066 
00067         void setDrawState (MWMechanics::DrawState_ state);
00068 
00069         bool getAutoMove() const;
00070 
00071         MWMechanics::DrawState_ getDrawState(); 
00072 
00073         void setAutoMove (bool enable);
00074 
00075         void setLeftRight (int value);
00076 
00077         void setForwardBackward (int value);
00078         void setUpDown(int value);
00079 
00080         void setRunState(bool run);
00081         void setSneak(bool sneak);
00082 
00083         void yaw(float yaw);
00084         void pitch(float pitch);
00085         void roll(float roll);
00086 
00087         bool wasTeleported() const;
00088         void setTeleported(bool teleported);
00089     };
00090 }
00091 #endif