From 9effa7c975f38ec815c4987fb9822408bee6ab0a Mon Sep 17 00:00:00 2001 From: Dmitry Panin Date: Sun, 1 Dec 2013 01:01:57 +0400 Subject: [PATCH] Slightly changed formatting while investigating src --- projects/mtg/include/MTGDeck.h | 2 +- projects/mtg/src/AllAbilities.cpp | 12 ++++++------ projects/mtg/src/MTGAbility.cpp | 4 ++-- projects/mtg/src/Subtypes.cpp | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/projects/mtg/include/MTGDeck.h b/projects/mtg/include/MTGDeck.h index 577d83c8f..c17e83189 100644 --- a/projects/mtg/include/MTGDeck.h +++ b/projects/mtg/include/MTGDeck.h @@ -138,7 +138,7 @@ public: static int findType(string subtype, bool forceAdd = true) { boost::mutex::scoped_lock lock(instance->mMutex); - int result = instance->subtypesList.find(subtype, forceAdd); + int result = instance->subtypesList.find(subtype, forceAdd); return result; }; static int add(string value, unsigned int parentType) { diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 53ba1bcbe..feaccb371 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -823,13 +823,13 @@ int GenericChooseTypeColor::resolve() for (size_t i = 0; i < values.size(); ++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); - MTGAbility * set = setType->clone(); - set->oneShot = true; - selection.push_back(set); - SAFE_DELETE(setType); + setType = NEW AASetTypeChosen(game, game->mLayers->actionLayer()->getMaxId(), source,(MTGCardInstance*)target, i,menu,baseAbility); + MTGAbility * set = setType->clone(); + set->oneShot = true; + selection.push_back(set); + SAFE_DELETE(setType); } } } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5a5fb68ca..022efba29 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -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); choose = NEW GenericActivatedAbility(observer, "","",id, card,choose,NULL); @@ -3272,7 +3272,7 @@ MTGAbility * AbilityFactory::parseChooseActionAbility(string s,MTGCardInstance * a->canBeInterrupted = false; return a; } - //choose a color + //choose a color vector splitChooseAColor = parseBetween(s, "chooseacolor ", " chooseend"); if (splitChooseAColor.size()) { diff --git a/projects/mtg/src/Subtypes.cpp b/projects/mtg/src/Subtypes.cpp index c8a9d170e..446aec08e 100644 --- a/projects/mtg/src/Subtypes.cpp +++ b/projects/mtg/src/Subtypes.cpp @@ -54,7 +54,9 @@ int Subtypes::add(string value, unsigned int parentType) } 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); } return subtype; @@ -115,8 +117,7 @@ void Subtypes::sortSubTypes() const vector& Subtypes::getCreatureValuesById() { - sort(subtypesCreature.begin(),subtypesCreature.end()); - subtypesCreature.erase(unique(subtypesCreature.begin(),subtypesCreature.end()),subtypesCreature.end()); + sortSubTypes(); return subtypesCreature; }