- fixed memory leaks introduced in previous revision

- removed incorrect casts of MTGCardInstance into Spell objects.
- AI Test system now allows you to put decks in ai/bakaA and ai/bakaB instead of ai/baka. This allows to let AIPlayerBaka and AIPlayerBakaB play with specific decks
- Test suite speed improvement. Improved the card name cache. Test suite now runs in 850 seconds instead of 950 on my machine.
- minor code cleanup
This commit is contained in:
wagic.the.homebrew
2011-09-22 04:43:05 +00:00
parent 997b154d46
commit ee4c7e23bd
15 changed files with 163 additions and 85 deletions

View File

@@ -243,7 +243,7 @@ Interruptible(id), tc(tc), cost(_cost), payResult(payResult)
int Spell::computeX(MTGCardInstance * card)
{
ManaCost * c = NEW ManaCost(cost->Diff(card->getManaCost()));
ManaCost * c = cost->Diff(card->getManaCost());
int x = c->getCost(Constants::MTG_NB_COLORS);
delete c;
return x;
@@ -763,7 +763,7 @@ int ActionStack::count(int type, int state, int display)
return result;
}
int ActionStack::getActionElementFromCard(MTGCardInstance * card)
Interruptible * ActionStack::getActionElementFromCard(MTGCardInstance * card)
{
if(!card)
@@ -773,10 +773,10 @@ int ActionStack::getActionElementFromCard(MTGCardInstance * card)
Interruptible * current = (Interruptible *) mObjects[i];
if (current->source == card)
{
return i;
return current;
}
}
return 0;
return NULL;
}
Interruptible * ActionStack::getNext(Interruptible * previous, int type, int state, int display)