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

134 lines
2.8 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_PLAYER_H
#define GAME_MWWORLD_PLAYER_H
#include "OgreCamera.h"
#include "../mwworld/cellstore.hpp"
#include "../mwworld/refdata.hpp"
2010-07-26 12:59:50 +02:00
#include "../mwworld/ptr.hpp"
#include "../mwmechanics/drawstate.hpp"
#undef DrawState // How did this get defined again?
// Maybe it's defined by default in every file for windows?
namespace MWBase
{
class World;
}
namespace MWRender
{
class Player;
}
namespace MWWorld
{
class CellStore;
/// \brief NPC object representing the player and additional player data
class Player
2010-07-26 12:59:50 +02:00
{
LiveCellRef<ESM::NPC> mPlayer;
MWWorld::CellStore *mCellStore;
MWRender::Player *mRenderer;
2011-01-06 10:07:01 +01:00
std::string mName;
bool mMale;
std::string mRace;
std::string mBirthsign;
ESM::Class *mClass;
2011-01-18 15:20:36 +01:00
bool mAutoMove;
2011-02-03 12:16:59 +01:00
int mForwardBackward;
2011-01-06 10:07:01 +01:00
public:
2010-06-22 10:15:22 +02:00
Player(MWRender::Player *renderer, const ESM::NPC *player, const MWBase::World& world);
2011-01-06 10:07:01 +01:00
~Player();
2011-01-06 10:07:01 +01:00
/// Set the player position. Uses Morrowind coordinates.
2011-09-04 09:48:50 +02:00
void setPos(float x, float y, float z);
/// Set where the player is looking at. Uses Morrowind (euler) angles
void setRot(float x, float y, float z);
void setCell (MWWorld::CellStore *cellStore)
2011-01-06 10:07:01 +01:00
{
mCellStore = cellStore;
}
MWWorld::Ptr getPlayer()
{
MWWorld::Ptr ptr (&mPlayer, mCellStore);
return ptr;
}
MWRender::Player *getRenderer() { return mRenderer; }
void setName (const std::string& name)
{
mName = name;
}
void setGender (bool male)
{
mMale = male;
}
void setRace (const std::string& race)
{
mRace = race;
}
void setBirthsign (const std::string& birthsign)
{
mBirthsign = birthsign;
}
void setClass (const ESM::Class& class_);
void setDrawState (MWMechanics::DrawState state);
std::string getName() const
{
return mName;
}
bool isMale() const
{
return mMale;
}
std::string getRace() const
{
return mRace;
}
std::string getBirthsign() const
{
return mBirthsign;
}
const ESM::Class& getClass() const
{
return *mClass;
}
2012-06-06 20:29:30 +02:00
bool getAutoMove() const
2011-01-18 15:20:36 +01:00
{
return mAutoMove;
}
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
2011-02-03 12:16:59 +01:00
void toggleRunning();
2011-01-18 15:20:36 +01:00
};
}
#endif