Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ogs::magic::SpellList Class Reference

A spell list associates spells with cclasses and domains. More...

#include <SpellList.h>

List of all members.

Public Member Functions

template<class CasterClass, class SpellClass> int getLevel () const
 Determine the spell level for a class of spell and caster.

template<class CasterClass, class SpellClass> int getLevel (const SpellClass &spell) const
 Determine the spell level for a spell and a class of caster.


Protected Types

typedef std::map< Class, int > SpellMap
 A spell maps map spells (derived classes of Spell) to the equivalent spell level.

typedef std::map< Class, SpellMapCasterMap
 A caster map maps casters (derived classes of CClass or Domain) to a map of spells.


Protected Member Functions

 SpellList ()
 Create an empty spell list.


Protected Attributes

CasterMap casterMap
 A spell list is implemented with a map of maps.


Detailed Description

The association between a spell and a cclass or domain determines the spell level. A spell level is an integer value that can range from 0 to 9.


Member Function Documentation

template<class CasterClass, class SpellClass>
int ogs::magic::SpellList::getLevel const SpellClass &  spell  )  const
 

This function takes into account any metamagic feats that are attached to the spell. If the spell has any metamagic feats, the total slots from the metamagic feats are added to the spell's normal level. The class of caster may be a class derived from CClass or Domain.

Parameters:
spell A spell object.
Returns:
Spell level or null if not caster and spell not found.
Exceptions:
std::bad_cast If one of the classes is not derived from the correct class.
NotRelated If the spell and caster are not related.

template<class CasterClass, class SpellClass>
int ogs::magic::SpellList::getLevel  )  const
 

The class of spell must be a class dervied from the Spell class. The class of caster must be a class derived from CClass or Domain.

Returns:
Spell level or null if not caster and spell not found.
Exceptions:
std::bad_cast If one of the classes is not derived from the correct class.
NotFound If the spell or caster are not found.


Member Data Documentation

CasterMap ogs::magic::SpellList::casterMap [protected]
 

The first map is the caster map. Derived classes must build the caster map and spell maps.


The documentation for this class was generated from the following file:
Generated on Sun Apr 20 03:40:09 2003 for Open Gaming System (OGS) by doxygen1.3