Test framework: added support to create custom instant/sorcery;

This commit is contained in:
Oleg Agafonov 2019-06-26 21:40:17 +04:00
parent b0489c3a61
commit 7e08b3c3d5
2 changed files with 63 additions and 14 deletions

View file

@ -335,6 +335,19 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
ability.addWatcher(watcher);
}
public void replaceSpellAbility(SpellAbility newAbility) {
SpellAbility oldAbility = this.getSpellAbility();
while (oldAbility != null) {
abilities.remove(oldAbility);
spellAbility = null;
oldAbility = this.getSpellAbility();
}
if (newAbility != null) {
addAbility(newAbility);
}
}
@Override
public SpellAbility getSpellAbility() {
if (spellAbility == null) {