00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef __cplusplus
00024
00025 # ifndef OGS_MAGIC_METAMAGIC_FEAT_H
00026 # define OGS_MAGIC_METAMAGIC_FEAT_H
00027
00028 # include <ogs/core/Feat.h>
00029 # include <ogs/magic/Namespace.h>
00030 # include <ogs/magic/Types.h>
00031
00032 OGS_BEGIN_MAGIC_NAMESPACE
00033
00034 class Spell;
00035
00046 class MetamagicFeat: public ogs::core::Feat {
00047 public:
00049 typedef SpellLevel Cost;
00050
00051 Cost getCost () const;
00052
00053 virtual bool attachSpell (Spell& spell);
00054 virtual bool detachSpell ();
00055 Spell* getSpell () const;
00056
00057 virtual ~MetamagicFeat () = 0;
00058
00059 protected:
00060 MetamagicFeat (Cost cost);
00061
00062 virtual bool canAttachSpell (Spell& spell) const;
00063 virtual bool canDetachSpell () const;
00064
00065 private:
00066 Cost _cost;
00067 Spell* _spell;
00068 };
00069
00075 inline MetamagicFeat::MetamagicFeat (Cost cost):
00076 Feat (EXCLUSIVE, MAGIC),
00077 _cost (cost),
00078 _spell (NULL) {
00079
00080 }
00081
00087 inline MetamagicFeat::Cost
00088 MetamagicFeat::getCost () const {
00089 return (this->_cost);
00090 }
00091
00097 inline Spell*
00098 MetamagicFeat::getSpell () const {
00099 return (this->_spell);
00100 }
00101
00107 inline bool
00108 MetamagicFeat::canAttachSpell (Spell& spell) const {
00109 return (this->_spell == NULL);
00110 }
00111
00118 inline bool
00119 MetamagicFeat::canDetachSpell () const {
00120 return (false);
00121 }
00122
00123 inline MetamagicFeat::~MetamagicFeat () { }
00124
00125 OGS_END_MAGIC_NAMESPACE
00126
00127 # endif
00128
00129 #endif
00130