Converted CardPrimitive's basicAbilities from a map<int, int> to a bitset. With 92 abilities, that means our base container for abilities is now 16 bytes in size (down from 28), and is a fixed size, whereas the map would grow by 8 bytes per added ability.

This commit is contained in:
wrenczes@gmail.com
2011-04-26 09:35:38 +00:00
parent 425e49e608
commit a73fd4e99f
10 changed files with 74 additions and 90 deletions

View File

@@ -1095,9 +1095,10 @@ void MTGDeck::printDetailedDeckText(std::ofstream& file )
if ( card->data->hasRestriction )
currentCard << ", " << card->data->otherrestriction;
map<int,int>::iterator abilityIter;
for ( abilityIter = card->data->basicAbilities.begin(); abilityIter != card->data->basicAbilities.end(); ++abilityIter )
currentCard << Constants::MTGBasicAbilities[ abilityIter->first ] << "; ";
for (size_t x = 0; card->data->basicAbilities.size(); ++x)
{
currentCard << Constants::MTGBasicAbilities[x] << "; ";
}
currentCard <<endl;
for ( int i = 0; i < nbCards; i++ )