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

119 lines
2.3 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 10:59:50 +00:00
#include "../mwworld/ptr.hpp"
namespace MWRender
{
class Player;
}
namespace MWWorld
{
class World;
/// \brief NPC object representing the player and additional player data
2011-01-06 09:07:01 +00:00
class Player
2010-07-26 10:59:50 +00:00
{
2011-01-06 09:07:01 +00:00
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> mPlayer;
MWWorld::Ptr::CellStore *mCellStore;
MWRender::Player *mRenderer;
2011-01-06 09:07:01 +00:00
MWWorld::World& mWorld;
std::string mName;
bool mMale;
std::string mRace;
std::string mBirthsign;
ESM::Class *mClass;
2011-01-18 14:20:36 +00:00
bool mAutoMove;
2011-02-03 11:16:59 +00:00
int mForwardBackward;
2011-01-06 09:07:01 +00:00
public:
2010-06-22 08:15:22 +00:00
Player(MWRender::Player *renderer, const ESM::NPC *player, MWWorld::World& world);
2011-01-06 09:07:01 +00:00
~Player();
2011-01-06 09:07:01 +00:00
/// Set the player position. Uses Morrowind coordinates.
2011-09-04 07:48:50 +00:00
void setPos(float x, float y, float z);
2011-01-06 09:07:01 +00:00
void setCell (MWWorld::Ptr::CellStore *cellStore)
{
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_);
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;
}
2011-01-18 14:20:36 +00:00
bool getAutoMove()
{
return mAutoMove;
}
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);
2011-01-18 14:20:36 +00:00
2011-02-03 11:16:59 +00:00
void toggleRunning();
2011-01-18 14:20:36 +00:00
};
}
#endif