- Replaced the BasicAbilities Array with a map. This reduces the size of MTGCard from >500 bytes to 392. Should be cool for people who have memory issues
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-06-25 11:09:51 +00:00
parent f643f87b83
commit 71cc79b949
9 changed files with 23 additions and 14 deletions

View File

@@ -91,7 +91,8 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card){
//Abilities
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
for(map<int,int>::const_iterator it = basicAbilities.begin(); it != basicAbilities.end(); ++it){
int j = it->first;
if ((basicAbilities[j] == 1 && !card->basicAbilities[j]) || (basicAbilities[j] == -1 && card->basicAbilities[j])){
match = NULL;
}