This removes the compilation error introduced with r4237. I needed this in place to make an iOS build.

This commit is contained in:
techdragon.nguyen@gmail.com
2012-02-01 04:17:30 +00:00
parent 2f408664ad
commit ac992675da
4 changed files with 17 additions and 23 deletions

View File

@@ -81,7 +81,8 @@ class AIPlayerBaka: public AIPlayer{
//Tries to play an ability recommended by the deck creator //Tries to play an ability recommended by the deck creator
virtual int selectHintAbility(); virtual int selectHintAbility();
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card = NULL,ManaCost * mCost = NULL, map<MTGCardInstance*, bool>usedCards = map<MTGCardInstance*,bool>()); virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card = NULL, ManaCost * mCost = NULL);
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card, ManaCost * mCost, map<MTGCardInstance*, bool> &usedCards);
virtual vector<MTGAbility*> canPaySunBurst(ManaCost * mCost = NULL); virtual vector<MTGAbility*> canPaySunBurst(ManaCost * mCost = NULL);
virtual MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0); virtual MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0);

View File

@@ -28,9 +28,6 @@ protected:
//Tries to play an ability recommended by the deck creator //Tries to play an ability recommended by the deck creator
int selectHintAbility(); int selectHintAbility();
vector<MTGAbility*> canPayMana(MTGCardInstance * card = NULL,ManaCost * mCost = NULL);
vector<MTGAbility*> canPaySunBurst(ManaCost * mCost = NULL);
MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0); MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0);
int selectMenuOption(); int selectMenuOption();
int useAbility(); int useAbility();

View File

@@ -834,19 +834,28 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
return result; return result;
} }
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool>usedCards ) vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost)
{ {
if(!cost || (cost && !cost->getConvertedCost())) if(!cost || (cost && !cost->getConvertedCost()) || !target)
return vector<MTGAbility*>();
map<MTGCardInstance*, bool> usedCards;
return canPayMana(target, cost, usedCards);
}
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool> &used )
{
if(!cost->getConvertedCost())
return vector<MTGAbility*>(); return vector<MTGAbility*>();
ManaCost * result = NEW ManaCost(); ManaCost * result = NEW ManaCost();
map<MTGCardInstance *, bool> used = usedCards;
vector<MTGAbility*>payments = vector<MTGAbility*>(); vector<MTGAbility*>payments = vector<MTGAbility*>();
if (this->getManaPool()->getConvertedCost()) if (this->getManaPool()->getConvertedCost())
{ {
//adding the current manapool if any. //adding the current manapool if any.
result->add(this->getManaPool()); result->add(this->getManaPool());
} }
int needColorConverted = cost->getConvertedCost()-int(cost->getCost(0)+cost->getCost(7)); int needColorConverted = cost->getConvertedCost() - int(cost->getCost(0)+cost->getCost(7));
int fullColor = 0; int fullColor = 0;
for (size_t i = 0; i < observer->mLayers->actionLayer()->manaObjects.size(); i++) for (size_t i = 0; i < observer->mLayers->actionLayer()->manaObjects.size(); i++)
{ {
@@ -1007,7 +1016,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
return payments;//we didn't meet one of the color cost requirements. return payments;//we didn't meet one of the color cost requirements.
} }
} }
if(cost->kicker && !usedCards.size()) if(cost->kicker && !used.size())
{ {
ManaCost * withKickerCost= NEW ManaCost(cost->kicker); ManaCost * withKickerCost= NEW ManaCost(cost->kicker);
@@ -1016,7 +1025,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
bool keepLooking = true; bool keepLooking = true;
while(keepLooking) while(keepLooking)
{ {
kickerPayment = canPayMana(target,withKickerCost,used); kickerPayment = canPayMana(target, withKickerCost, used);
if(kickerPayment.size()) if(kickerPayment.size())
{ {
for(unsigned int w = 0;w < kickerPayment.size();++w) for(unsigned int w = 0;w < kickerPayment.size();++w)

View File

@@ -25,8 +25,6 @@ bool AIPlayerBakaB::payTheManaCost(ManaCost * cost, MTGCardInstance * target, ve
return AIPlayerBaka::payTheManaCost(cost, target, gotPayments); return AIPlayerBaka::payTheManaCost(cost, target, gotPayments);
} }
int AIPlayerBakaB::getEfficiency(OrderedAIAction * action) int AIPlayerBakaB::getEfficiency(OrderedAIAction * action)
{ {
return AIPlayerBaka::getEfficiency(action); return AIPlayerBaka::getEfficiency(action);
@@ -37,17 +35,6 @@ ManaCost * AIPlayerBakaB::getPotentialMana(MTGCardInstance * target)
return AIPlayerBaka::getPotentialMana(target); return AIPlayerBaka::getPotentialMana(target);
} }
vector<MTGAbility*> AIPlayerBakaB::canPayMana(MTGCardInstance * target,ManaCost * cost)
{
return AIPlayerBaka::canPayMana(target, cost);
}
vector<MTGAbility*> AIPlayerBakaB::canPaySunBurst(ManaCost * cost)
{
return AIPlayerBaka::canPaySunBurst(cost);
}
int AIPlayerBakaB::CanHandleCost(ManaCost * cost) int AIPlayerBakaB::CanHandleCost(ManaCost * cost)
{ {
return AIPlayerBaka::CanHandleCost(cost); return AIPlayerBaka::CanHandleCost(cost);