diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index e14b0ede6b8..390fa9ca5b5 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -109,7 +109,8 @@ public class Card extends GameEntity implements Comparable, IHasSVars { private final Table> hiddenExtrinsicKeywords = TreeBasedTable.create(); // cards attached or otherwise linked to this card - private CardCollection hauntedBy, devouredCards, exploitedCards, delvedCards, convokedCards, imprintedCards, encodedCards; + private CardCollection hauntedBy, devouredCards, exploitedCards, delvedCards, convokedCards, imprintedCards, + exiledCards, encodedCards; private CardCollection gainControlTargets, chosenCards; private CardCollection mergedCards; private Map mustBlockCards = Maps.newHashMap(); @@ -1082,6 +1083,31 @@ public class Card extends GameEntity implements Comparable, IHasSVars { imprintedCards = view.clearCards(imprintedCards, TrackableProperty.ImprintedCards); } + public final CardCollectionView getExiledCards() { + return CardCollection.getView(exiledCards); + } + public final boolean hasExiledCard() { + return FCollection.hasElements(exiledCards); + } + public final boolean hasExiledCard(Card c) { + return FCollection.hasElement(exiledCards, c); + } + public final void addExiledCard(final Card c) { + exiledCards = view.addCard(exiledCards, c, TrackableProperty.ExiledCards); + } + public final void addExiledCards(final Iterable cards) { + exiledCards = view.addCards(exiledCards, cards, TrackableProperty.ExiledCards); + } + public final void removeExiledCard(final Card c) { + exiledCards = view.removeCard(exiledCards, c, TrackableProperty.ExiledCards); + } + public final void removeExiledCards(final Iterable cards) { + exiledCards = view.removeCards(exiledCards, cards, TrackableProperty.ExiledCards); + } + public final void clearExiledCards() { + exiledCards = view.clearCards(exiledCards, TrackableProperty.ExiledCards); + } + public final CardCollectionView getEncodedCards() { return CardCollection.getView(encodedCards); } @@ -1686,6 +1712,7 @@ public class Card extends GameEntity implements Comparable, IHasSVars { return; } + exiledWith.removeExiledCard(this); exiledWith.removeUntilLeavesBattlefield(this); exiledWith = null;