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

58 lines
1.2 KiB
C++
Raw Normal View History

2012-04-11 16:29:36 +00:00
#ifndef GAME_MWMECHANICS_SPELLS_H
#define GAME_MWMECHANICS_SPELLS_H
#include <vector>
2012-04-11 17:40:42 +00:00
#include <string>
namespace ESM
{
struct Spell;
}
2012-04-11 16:29:36 +00:00
namespace MWWorld
{
struct Environment;
}
namespace MWMechanics
{
class MagicEffects;
/// \brief Spell list
///
/// This class manages known spells as well as abilities, powers and permanent negative effects like
/// diseaes.
class Spells
{
public:
2012-04-11 17:40:42 +00:00
typedef std::vector<std::string> TContainer;
2012-04-11 16:29:36 +00:00
typedef TContainer::const_iterator TIterator;
private:
2012-04-11 17:40:42 +00:00
std::vector<std::string> mSpells;
2012-04-11 16:29:36 +00:00
void addSpell (const ESM::Spell *, MagicEffects& effects) const;
public:
2012-04-11 17:40:42 +00:00
TIterator begin() const;
2012-04-11 16:29:36 +00:00
2012-04-11 17:40:42 +00:00
TIterator end() const;
2012-04-11 16:29:36 +00:00
2012-04-11 17:40:42 +00:00
void add (const std::string& spell);
2012-04-11 16:29:36 +00:00
/// \note Adding a spell that is already listed in *this is a no-op.
2012-04-11 17:40:42 +00:00
void remove (const std::string& spell);
2012-04-11 16:29:36 +00:00
2012-04-11 17:40:42 +00:00
MagicEffects getMagicEffects (const MWWorld::Environment& environment) const;
2012-04-11 16:29:36 +00:00
///< Return sum of magic effects resulting from abilities, blights, deseases and curses.
void clear();
///< Remove all spells of al types.
};
}
#endif