- fix issue 94 (enchant enchantments)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-10-01 13:33:40 +00:00
parent 706f17113b
commit 59eb79fc47
7 changed files with 80 additions and 18 deletions
+30 -2
View File
@@ -114,8 +114,36 @@ const string MTGCardInstance::getDisplayName() const {
}
void MTGCardInstance::addType(int type){
types[nb_types] = type;
nb_types++;
bool before = hasType(type);
MTGCard::addType(type);
WEvent * e = NEW WEventCardChangeType(this,type,before,true);
GameObserver::GetInstance()->receiveEvent(e);
}
void MTGCardInstance::addType(char * type_text){
setSubtype(type_text);
}
void MTGCardInstance::setType(const char * type_text){
setSubtype(type_text);
}
void MTGCardInstance::setSubtype(string value){
int id = Subtypes::subtypesList->Add(value);
addType(id);
}
int MTGCardInstance::removeType(string value,int removeAll){
int id = Subtypes::subtypesList->Add(value);
return removeType(id,removeAll);
}
int MTGCardInstance::removeType(int id, int removeAll){
bool before = hasType(id);
int result = MTGCard::removeType(id,removeAll);
bool after = hasType(id);
WEvent * e = NEW WEventCardChangeType(this,id,before,after);
GameObserver::GetInstance()->receiveEvent(e);
return result;
}
UntapBlockers * MTGCardInstance::getUntapBlockers(){