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

@ -12,6 +12,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.constants.*;
import mage.game.Controllable;
import mage.game.Game;
@ -580,6 +581,15 @@ public interface Ability extends Controllable, Serializable {
*/
MageObject getSourceObjectIfItStillExists(Game game);
/**
* See getSourceObjectIfItStillExists for details. Works with Card only.
*
* @param game
* @return
*/
Card getSourceCardIfItStillExists(Game game);
/**
* See getSourceObjectIfItStillExists for details. Works with Permanent only.
*