made the fix to color= a fancy loop deal by request of wololo

This commit is contained in:
omegablast2002@yahoo.com
2010-10-17 13:48:59 +00:00
parent 6a81228275
commit 35fa4d9786
+7 -16
View File
@@ -89,25 +89,16 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
{ {
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;
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
size_t found = value.find(Constants::MTGColorStrings[j]);
if (found != string::npos){ if (found != string::npos){
primitive->setColor(1,0); colors.push_back(j);
} }
found = value.find("blue");
if (found != string::npos){
primitive->setColor(2,0);
} }
found = value.find("red"); list<int>::iterator it;
if(found != string::npos){ for ( it=colors.begin() ; it != colors.end(); it++ ){
primitive->setColor(3,0); primitive->setColor(*it);
}
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;