Slightly changed formatting while investigating src

This commit is contained in:
Dmitry Panin
2013-12-01 01:01:57 +04:00
parent a70259b5ba
commit 9effa7c975
4 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ public:
static int findType(string subtype, bool forceAdd = true) { static int findType(string subtype, bool forceAdd = true) {
boost::mutex::scoped_lock lock(instance->mMutex); boost::mutex::scoped_lock lock(instance->mMutex);
int result = instance->subtypesList.find(subtype, forceAdd); int result = instance->subtypesList.find(subtype, forceAdd);
return result; return result;
}; };
static int add(string value, unsigned int parentType) { static int add(string value, unsigned int parentType) {
+6 -6
View File
@@ -823,13 +823,13 @@ int GenericChooseTypeColor::resolve()
for (size_t i = 0; i < values.size(); ++i) for (size_t i = 0; i < values.size(); ++i)
{ {
string menu = values[i]; string menu = values[i];
if(!ANonWall || (menu != "wall" && menu != "Wall")) if (!ANonWall || (menu != "wall" && menu != "Wall"))
{ {
setType = NEW AASetTypeChosen(game, game->mLayers->actionLayer()->getMaxId(), source,(MTGCardInstance*)target, i,menu,baseAbility); setType = NEW AASetTypeChosen(game, game->mLayers->actionLayer()->getMaxId(), source,(MTGCardInstance*)target, i,menu,baseAbility);
MTGAbility * set = setType->clone(); MTGAbility * set = setType->clone();
set->oneShot = true; set->oneShot = true;
selection.push_back(set); selection.push_back(set);
SAFE_DELETE(setType); SAFE_DELETE(setType);
} }
} }
} }
+2 -2
View File
@@ -1145,7 +1145,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
} }
if(s.compare(0, strlen("chooseacolor "), "chooseacolor ") == 0 || s.compare(0, strlen("chooseatype "), "chooseatype ") == 0) if (StartsWith(s, "chooseacolor ") || StartsWith(s, "chooseatype "))
{ {
MTGAbility * choose = parseChooseActionAbility(s,card,spell,target,0,id); MTGAbility * choose = parseChooseActionAbility(s,card,spell,target,0,id);
choose = NEW GenericActivatedAbility(observer, "","",id, card,choose,NULL); choose = NEW GenericActivatedAbility(observer, "","",id, card,choose,NULL);
@@ -3272,7 +3272,7 @@ MTGAbility * AbilityFactory::parseChooseActionAbility(string s,MTGCardInstance *
a->canBeInterrupted = false; a->canBeInterrupted = false;
return a; return a;
} }
//choose a color //choose a color
vector<string> splitChooseAColor = parseBetween(s, "chooseacolor ", " chooseend"); vector<string> splitChooseAColor = parseBetween(s, "chooseacolor ", " chooseend");
if (splitChooseAColor.size()) if (splitChooseAColor.size())
{ {
+4 -3
View File
@@ -54,7 +54,9 @@ int Subtypes::add(string value, unsigned int parentType)
} }
if (isSubType(subtype) && (parentType == TYPE_CREATURE)) if (isSubType(subtype) && (parentType == TYPE_CREATURE))
{ {
if(value != "forest" && value != "Forest")//http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=136196 one creature with a land subtype exist, but the card has special ruling. if (value != "forest" && value != "Forest")
//http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=136196
//one creature with a land subtype exist, but the card has special ruling.
subtypesCreature.push_back(value); subtypesCreature.push_back(value);
} }
return subtype; return subtype;
@@ -115,8 +117,7 @@ void Subtypes::sortSubTypes()
const vector<string>& Subtypes::getCreatureValuesById() const vector<string>& Subtypes::getCreatureValuesById()
{ {
sort(subtypesCreature.begin(),subtypesCreature.end()); sortSubTypes();
subtypesCreature.erase(unique(subtypesCreature.begin(),subtypesCreature.end()),subtypesCreature.end());
return subtypesCreature; return subtypesCreature;
} }