mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Test framework: added support to create custom instant/sorcery;
This commit is contained in:
parent
b0489c3a61
commit
7e08b3c3d5
2 changed files with 63 additions and 14 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue