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

66 lines
1.6 KiB
C++
Raw Normal View History

2010-08-19 10:49:13 +00:00
#ifndef GAME_MWMECHANICS_NPCSTATS_H
#define GAME_MWMECHANICS_NPCSTATS_H
#include <map>
#include <set>
#include <string>
2010-08-19 10:49:13 +00:00
#include "stat.hpp"
#include "drawstate.hpp"
2010-08-19 10:49:13 +00:00
namespace MWMechanics
{
/// \brief Additional stats for NPCs
///
/// For non-NPC-specific stats, see the CreatureStats struct.
///
/// \note For technical reasons the spell list and the currently selected spell is also handled by
/// CreatureStats, even though they are actually NPC stats.
2010-08-19 10:49:13 +00:00
class NpcStats
2010-08-19 10:49:13 +00:00
{
public:
enum Flag
{
Flag_ForceRun = 1,
Flag_ForceSneak = 2,
Flag_Run = 4,
Flag_Sneak = 8
};
private:
/// NPCs other than the player can only have one faction. But for the sake of consistency
/// we use the same data structure for the PC and the NPCs.
/// \note the faction key must be in lowercase
std::map<std::string, int> mFactionRank;
2011-01-18 09:45:29 +00:00
DrawState mDrawState;
unsigned int mMovementFlags;
Stat<float> mSkill[27];
public:
2011-01-18 09:45:29 +00:00
NpcStats();
DrawState getDrawState() const;
void setDrawState (DrawState state);
bool getMovementFlag (Flag flag) const;
void setMovementFlag (Flag flag, bool state);
const Stat<float>& getSkill (int index) const;
Stat<float>& getSkill (int index);
std::map<std::string, int>& getFactionRanks();
const std::map<std::string, int>& getFactionRanks() const;
2010-08-19 10:49:13 +00:00
};
}
#endif