This commit is contained in:
19
projects/mtg/src/MTGSpellStack.cpp
Normal file
19
projects/mtg/src/MTGSpellStack.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user