Erwan
- removed useless "color=" lines - Added color override for cards such as crimson kobolds (note: color should be after the "mana" line to avoid side effects)
This commit is contained in:
@@ -128,6 +128,14 @@ bool MTGCard::isSpell(){
|
||||
return (!isCreature() && !isLand());
|
||||
}
|
||||
|
||||
void MTGCard::setColor(string _color, int removeAllOthers){
|
||||
if(_color.compare("blue")==0) return setColor(Constants::MTG_COLOR_BLUE,removeAllOthers);
|
||||
if(_color.compare("red")==0) return setColor(Constants::MTG_COLOR_RED,removeAllOthers);
|
||||
if(_color.compare("green")==0) return setColor(Constants::MTG_COLOR_GREEN,removeAllOthers);
|
||||
if(_color.compare("black")==0) return setColor(Constants::MTG_COLOR_BLACK,removeAllOthers);
|
||||
if(_color.compare("white")==0) return setColor(Constants::MTG_COLOR_WHITE,removeAllOthers);
|
||||
}
|
||||
|
||||
void MTGCard::setColor(int _color, int removeAllOthers){
|
||||
if (removeAllOthers){
|
||||
for (int i=0; i<Constants::MTG_NB_COLORS; i++){
|
||||
|
||||
@@ -89,6 +89,9 @@ int MTGAllCards::processConfLine(string s, MTGCard *card){
|
||||
}else if(key.compare("mana")==0){
|
||||
std::transform( value.begin(), value.end(), value.begin(),::tolower );
|
||||
card->setManaCost(value);
|
||||
} else if(key.compare("color")==0){
|
||||
std::transform( value.begin(), value.end(), value.begin(),::tolower );
|
||||
card->setColor(value,1);
|
||||
}else if(key.compare("type")==0){
|
||||
switch(value.c_str()[0]){
|
||||
case 'C':
|
||||
|
||||
Reference in New Issue
Block a user