OpenMW
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
MWMechanics::ActiveSpells Class Reference

Lasting spell effects. More...

#include <activespells.hpp>

List of all members.

Classes

struct  ActiveSpellParams
struct  Effect

Public Types

typedef std::multimap
< std::string,
ActiveSpellParams
TContainer
typedef TContainer::const_iterator TIterator

Public Member Functions

 ActiveSpells ()
void addSpell (const std::string &id, bool stack, std::vector< Effect > effects, const std::string &displayName)
 addSpell
void purgeEffect (short effectId)
 Remove all active effects with this id.
void purgeAll (float chance)
 Remove all active effects, if roll succeeds (for each effect)
bool isSpellActive (std::string id) const
 case insensitive
const MagicEffectsgetMagicEffects () const
void visitEffectSources (MWMechanics::EffectSourceVisitor &visitor) const

Private Member Functions

void update () const
void rebuildEffects () const
double timeToExpire (const TIterator &iterator) const
const TContainergetActiveSpells () const
TIterator begin () const
TIterator end () const

Private Attributes

TContainer mSpells
MagicEffects mEffects
bool mSpellsChanged
MWWorld::TimeStamp mLastUpdate

Detailed Description

Lasting spell effects.

Note:
The name of this class is slightly misleading, since it also handels lasting potion effects.

Member Typedef Documentation

typedef std::multimap<std::string, ActiveSpellParams > MWMechanics::ActiveSpells::TContainer
typedef TContainer::const_iterator MWMechanics::ActiveSpells::TIterator

Constructor & Destructor Documentation


Member Function Documentation

void MWMechanics::ActiveSpells::addSpell ( const std::string &  id,
bool  stack,
std::vector< Effect effects,
const std::string &  displayName 
)

addSpell

Add lasting effects

Parameters:
idID for stacking purposes.
stackIf false, the spell is not added if one with the same ID exists already.
effects
displayNameName for display in magic menu.
bool MWMechanics::ActiveSpells::isSpellActive ( std::string  id) const

case insensitive

void MWMechanics::ActiveSpells::purgeAll ( float  chance)

Remove all active effects, if roll succeeds (for each effect)

void MWMechanics::ActiveSpells::purgeEffect ( short  effectId)

Remove all active effects with this id.

double MWMechanics::ActiveSpells::timeToExpire ( const TIterator iterator) const [private]

Returns time (in in-game hours) until the spell pointed to by iterator expires.

void MWMechanics::ActiveSpells::update ( ) const [private]

Member Data Documentation


The documentation for this class was generated from the following files: