Files
wagic/projects/mtg/src/MTGSpellStack.cpp

23 lines
356 B
C++

#include "MTGSpellStack.h"
MTGSpellStack::MTGSpellStack()
{
cursor = -1;
}
void MTGSpellStack::addSpell(Ability * ability)
{
cursor++;
spellStack[cursor] ability;
}
int MTGSpellStack::resolve()
{
if (cursor < 0)
return 0;
int result = cursor;
cursor--;
(spellStack[cursor + 1])->resolve();
return (result + 1);
}