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

@@ -2406,17 +2406,21 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
}
}
}
for (it = colors.begin(); it != colors.end(); it++)
{
_target->setColor(*it);
}
for (it = abilities.begin(); it != abilities.end(); it++)
{
_target->basicAbilities[*it]++;
_target->basicAbilities.set(*it);
}
for (it = oldcolors.begin(); it != oldcolors.end(); it++)
{
}
if(newAbilityFound)
{
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
@@ -2499,18 +2503,22 @@ int ATransformer::destroy()
}
//iterators annoy me :/
}
for (it = colors.begin(); it != colors.end(); it++)
{
_target->removeColor(*it);
}
for (it = abilities.begin(); it != abilities.end(); it++)
{
_target->basicAbilities[*it]--;
_target->basicAbilities.reset(*it);
}
for (it = oldcolors.begin(); it != oldcolors.end(); it++)
{
_target->setColor(*it);
}
if (remove)
{
for (it = oldtypes.begin(); it != oldtypes.end(); it++)