This removes the compilation error introduced with r4237. I needed this in place to make an iOS build.
This commit is contained in:
@@ -81,7 +81,8 @@ class AIPlayerBaka: public AIPlayer{
|
||||
//Tries to play an ability recommended by the deck creator
|
||||
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 MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0);
|
||||
|
||||
@@ -28,9 +28,6 @@ protected:
|
||||
//Tries to play an ability recommended by the deck creator
|
||||
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);
|
||||
int selectMenuOption();
|
||||
int useAbility();
|
||||
|
||||
@@ -834,19 +834,28 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
|
||||
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*>();
|
||||
ManaCost * result = NEW ManaCost();
|
||||
map<MTGCardInstance *, bool> used = usedCards;
|
||||
|
||||
vector<MTGAbility*>payments = vector<MTGAbility*>();
|
||||
if (this->getManaPool()->getConvertedCost())
|
||||
{
|
||||
//adding the current manapool if any.
|
||||
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;
|
||||
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.
|
||||
}
|
||||
}
|
||||
if(cost->kicker && !usedCards.size())
|
||||
if(cost->kicker && !used.size())
|
||||
{
|
||||
|
||||
ManaCost * withKickerCost= NEW ManaCost(cost->kicker);
|
||||
@@ -1016,7 +1025,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
|
||||
bool keepLooking = true;
|
||||
while(keepLooking)
|
||||
{
|
||||
kickerPayment = canPayMana(target,withKickerCost,used);
|
||||
kickerPayment = canPayMana(target, withKickerCost, used);
|
||||
if(kickerPayment.size())
|
||||
{
|
||||
for(unsigned int w = 0;w < kickerPayment.size();++w)
|
||||
|
||||
@@ -25,8 +25,6 @@ bool AIPlayerBakaB::payTheManaCost(ManaCost * cost, MTGCardInstance * target, ve
|
||||
return AIPlayerBaka::payTheManaCost(cost, target, gotPayments);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AIPlayerBakaB::getEfficiency(OrderedAIAction * action)
|
||||
{
|
||||
return AIPlayerBaka::getEfficiency(action);
|
||||
@@ -37,17 +35,6 @@ ManaCost * AIPlayerBakaB::getPotentialMana(MTGCardInstance * 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)
|
||||
{
|
||||
return AIPlayerBaka::CanHandleCost(cost);
|
||||
|
||||
Reference in New Issue
Block a user