made the fix to color= a fancy loop deal by request of wololo
This commit is contained in:
@@ -84,33 +84,24 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c': //color
|
case 'c': //color
|
||||||
if (!primitive) primitive = NEW CardPrimitive();
|
if (!primitive) primitive = NEW CardPrimitive();
|
||||||
{
|
{
|
||||||
string value = val;
|
string value = val;
|
||||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||||
int found = value.find("green");
|
list<int>colors;
|
||||||
if (found != string::npos){
|
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
|
||||||
primitive->setColor(1,0);
|
size_t found = value.find(Constants::MTGColorStrings[j]);
|
||||||
}
|
if (found != string::npos){
|
||||||
found = value.find("blue");
|
colors.push_back(j);
|
||||||
if (found != string::npos){
|
}
|
||||||
primitive->setColor(2,0);
|
}
|
||||||
}
|
list<int>::iterator it;
|
||||||
found = value.find("red");
|
for ( it=colors.begin() ; it != colors.end(); it++ ){
|
||||||
if(found != string::npos){
|
primitive->setColor(*it);
|
||||||
primitive->setColor(3,0);
|
}
|
||||||
}
|
|
||||||
found = value.find("black");
|
|
||||||
if (found != string::npos){
|
|
||||||
primitive->setColor(4,0);
|
|
||||||
}
|
|
||||||
found = value.find("white");
|
|
||||||
if (found != string::npos){
|
|
||||||
primitive->setColor(5,0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'g': //grade
|
case 'g': //grade
|
||||||
if (s.size() - i - 1 > 2) currentGrade = getGrade(val[2]);
|
if (s.size() - i - 1 > 2) currentGrade = getGrade(val[2]);
|
||||||
|
|||||||
Reference in New Issue
Block a user