Add support for reducing Hybrid cost

it doesn't remove the hybrid icons but it reduces the cost.
This commit is contained in:
Anthony Calosa
2016-07-11 07:55:12 +08:00
parent a72fb6f01a
commit 69db7f7384
5 changed files with 231 additions and 161 deletions

View File

@@ -719,6 +719,37 @@ int ManaCost::countHybridsNoPhyrexian()
return result;
}
void ManaCost::removeHybrid(ManaCost * _manaCost)
{
if (!_manaCost)
return;
vector<int> colors;
int match = 0;
for(int j = 0; j < 7; j++)
{//populate colors values
colors.push_back(_manaCost->getCost(j));
}
for (size_t i = 0; i < hybrids.size(); i++)
{
for(int j = 0; j < 7; j++)
{
if(colors[j])
{
if(hybrids[i].hasColor(j))
{
hybrids[i].reduceValue(j, colors[j]);
colors[j] -= 1;
match++;
}
}
}
}
return;
}
int ManaCost::parseManaSymbol(char symbol)
{
switch (symbol)