#include #include "SpellT.h" #include "AttributeT.h" using namespace std; SpellT::SpellT(string spellName, string spellDescription, string spellResult): name{spellName}, description{spellDescription}, result{spellResult}, effects(AttributeT_COUNT,0) { } void SpellT::AddEffect(AttributeT a, int power){ effects[static_cast(a)] = power; } int SpellT::GetEffect(AttributeT a) const{ return effects[static_cast(a)]; } void SpellT::SetDuration(int givenDuration){ if (givenDuration > 0) { duration = givenDuration; } } void SpellT::Tick(){ if (duration > 0) { duration--; } } bool SpellT::Active() const{ return duration > 0; } string SpellT::GetSpellName() const{ return name; } string SpellT::GetDescription() const{ return description; } string SpellT::GetResult() const{ return result; }