avoid casting to Card with dedicated method getSourceCardIfItStillExists

This commit is contained in:
xenohedron 2024-06-02 19:39:58 -04:00
parent a90f226053
commit d226b30592
40 changed files with 150 additions and 178 deletions

View file

@ -16,6 +16,7 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.abilities.hint.Hint;
import mage.abilities.icon.CardIcon;
import mage.cards.Card;
import mage.cards.FrameStyle;
import mage.constants.*;
import mage.filter.predicate.mageobject.MageObjectReferencePredicate;
@ -642,6 +643,11 @@ public class StackAbility extends StackObjectImpl implements Ability {
return this.ability.getSourceObjectIfItStillExists(game);
}
@Override
public Card getSourceCardIfItStillExists(Game game) {
return this.ability.getSourceCardIfItStillExists(game);
}
@Override
public Permanent getSourcePermanentIfItStillExists(Game game) {
return this.ability.getSourcePermanentIfItStillExists(game);