mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Added a trackable property EncodedCards for Cipher.
- Added text information for encoded cards to the card detail box. - Fixed imports.
This commit is contained in:
@@ -720,26 +720,16 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return FCollection.hasElement(encodedCards, c);
|
||||
}
|
||||
public final void addEncodedCard(final Card c) {
|
||||
if (encodedCards == null) {
|
||||
encodedCards = new CardCollection();
|
||||
}
|
||||
encodedCards.add(c);
|
||||
encodedCards = view.addCard(encodedCards, c, TrackableProperty.EncodedCards);
|
||||
}
|
||||
public final void addEncodedCards(final Iterable<Card> cards) {
|
||||
if (encodedCards == null) {
|
||||
encodedCards = new CardCollection();
|
||||
}
|
||||
encodedCards.addAll(cards);
|
||||
encodedCards = view.addCards(encodedCards, cards, TrackableProperty.EncodedCards);
|
||||
}
|
||||
public final void removeEncodedCard(final Card c) {
|
||||
if (encodedCards.remove(c)) {
|
||||
if (encodedCards.isEmpty()) {
|
||||
encodedCards = null;
|
||||
}
|
||||
}
|
||||
encodedCards = view.removeCard(encodedCards, c, TrackableProperty.EncodedCards);
|
||||
}
|
||||
public final void clearEncodedCards() {
|
||||
encodedCards = null;
|
||||
encodedCards = view.clearCards(encodedCards, TrackableProperty.EncodedCards);
|
||||
}
|
||||
|
||||
public final String getFlipResult(final Player flipper) {
|
||||
|
||||
@@ -452,6 +452,10 @@ public class CardView extends GameEntityView {
|
||||
return getEquippedBy() != null; //isEmpty check not needed since we won't keep an empty collection around
|
||||
}
|
||||
|
||||
public FCollectionView<CardView> getEncodedCards() {
|
||||
return get(TrackableProperty.EncodedCards);
|
||||
}
|
||||
|
||||
public GameEntityView getEnchanting() {
|
||||
return get(TrackableProperty.Enchanting);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import forge.game.Direction;
|
||||
import forge.game.GameType;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.trackable.TrackableTypes;
|
||||
import forge.trackable.TrackableTypes.TrackableType;
|
||||
|
||||
public enum TrackableProperty {
|
||||
@@ -45,6 +44,7 @@ public enum TrackableProperty {
|
||||
Enchanting(TrackableTypes.GameEntityViewType),
|
||||
Fortifying(TrackableTypes.CardViewType),
|
||||
FortifiedBy(TrackableTypes.CardViewCollectionType),
|
||||
EncodedCards(TrackableTypes.CardViewCollectionType),
|
||||
GainControlTargets(TrackableTypes.CardViewCollectionType),
|
||||
CloneOrigin(TrackableTypes.CardViewType),
|
||||
Cloner(TrackableTypes.StringType),
|
||||
|
||||
@@ -557,6 +557,14 @@ public class CardDetailUtil {
|
||||
area.append("Haunting " + card.getHaunting());
|
||||
}
|
||||
|
||||
// Cipher
|
||||
if (card.getEncodedCards() != null) {
|
||||
if (area.length() != 0) {
|
||||
area.append("\n");
|
||||
}
|
||||
area.append("Encoded: " + card.getEncodedCards());
|
||||
}
|
||||
|
||||
// must block
|
||||
if (card.getMustBlockCards() != null) {
|
||||
if (area.length() != 0) {
|
||||
|
||||
Reference in New Issue
Block a user