|
-
November 12th, 2011, 12:07 AM
#3
Re: How do I save funtions to be called later?
So how does the enum parameter work? Within class CastSpell, I override PerformAction() and inside that function is a huge set of if/else statements?
Like, as a simple example somewhere in PerformAction() there might be a
Code:
if ( selected_spell == CastSpell::Sleep )
{
spellStrength = caster->magicPower();
attemptSetTargetStatusToAsleep ( target, spellStrength );
}
Does this mean that within the CastSpell class, I'd need to maintain (and update every time I add a new spell) within the if/else statements every single possible spell? Within the Action inheritance hierarchy, there would exist the entirety of the possibility of every single action?
My Creature objects never actually need to know how to perform any actions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|