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

105 lines
2.2 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_PLAYER_H
#define GAME_MWWORLD_PLAYER_H
#include "OgreCamera.h"
#include <components/esm_store/cell_store.hpp>
#include "../mwworld/refdata.hpp"
2010-07-26 12:59:50 +02:00
#include "../mwworld/ptr.hpp"
namespace MWWorld
{
class World;
}
namespace MWWorld
{
2011-01-06 10:07:01 +01:00
class Player
2010-07-26 12:59:50 +02:00
{
2011-01-06 10:07:01 +01:00
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> mPlayer;
MWWorld::Ptr::CellStore *mCellStore;
Ogre::Camera *camera;
MWWorld::World& mWorld;
std::string mName;
bool mMale;
std::string mRace;
std::string mBirthsign;
ESM::Class *mClass;
2011-01-06 10:07:01 +01:00
public:
2010-06-22 10:15:22 +02:00
2011-01-06 10:07:01 +01:00
Player(Ogre::Camera *cam, const ESM::NPC *player, MWWorld::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.
void setPos(float _x, float _y, float _z, bool updateCamera = false);
2011-01-06 10:07:01 +01:00
void setCell (MWWorld::Ptr::CellStore *cellStore)
{
mCellStore = cellStore;
}
2011-01-06 10:07:01 +01:00
Ogre::Camera *getCamera() { return camera; }
2011-01-06 10:07:01 +01:00
/// Move the player relative to her own position and
/// orientation. After the call, the new position is returned.
void moveRel (float &relX, float &relY, float &relZ);
MWWorld::Ptr getPlayer()
{
MWWorld::Ptr ptr (&mPlayer, mCellStore);
return ptr;
}
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_);
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;
}
};
}
#endif