forked from External/mage
refactor: introduce new helper method
to find permanent from card after moved to battlefield
This commit is contained in:
parent
f07aa6a4a3
commit
535543860f
4 changed files with 12 additions and 3 deletions
|
|
@ -1315,6 +1315,15 @@ public final class CardUtil {
|
|||
return permCard;
|
||||
}
|
||||
|
||||
/**
|
||||
* If a card object is moved to the battlefield, object id can be different (e.g. MDFC).
|
||||
* Use this method to get the permanent object from the card object after move to battlefield.
|
||||
* Can return null if not found on the battlefield.
|
||||
*/
|
||||
public static Permanent getPermanentFromCardPutToBattlefield(Card card, Game game) {
|
||||
return game.getPermanent(CardUtil.getDefaultCardSideForBattlefield(game, card).getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return card name for same name searching
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue