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);
|
return FCollection.hasElement(encodedCards, c);
|
||||||
}
|
}
|
||||||
public final void addEncodedCard(final Card c) {
|
public final void addEncodedCard(final Card c) {
|
||||||
if (encodedCards == null) {
|
encodedCards = view.addCard(encodedCards, c, TrackableProperty.EncodedCards);
|
||||||
encodedCards = new CardCollection();
|
|
||||||
}
|
|
||||||
encodedCards.add(c);
|
|
||||||
}
|
}
|
||||||
public final void addEncodedCards(final Iterable<Card> cards) {
|
public final void addEncodedCards(final Iterable<Card> cards) {
|
||||||
if (encodedCards == null) {
|
encodedCards = view.addCards(encodedCards, cards, TrackableProperty.EncodedCards);
|
||||||
encodedCards = new CardCollection();
|
|
||||||
}
|
|
||||||
encodedCards.addAll(cards);
|
|
||||||
}
|
}
|
||||||
public final void removeEncodedCard(final Card c) {
|
public final void removeEncodedCard(final Card c) {
|
||||||
if (encodedCards.remove(c)) {
|
encodedCards = view.removeCard(encodedCards, c, TrackableProperty.EncodedCards);
|
||||||
if (encodedCards.isEmpty()) {
|
|
||||||
encodedCards = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public final void clearEncodedCards() {
|
public final void clearEncodedCards() {
|
||||||
encodedCards = null;
|
encodedCards = view.clearCards(encodedCards, TrackableProperty.EncodedCards);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String getFlipResult(final Player flipper) {
|
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
|
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() {
|
public GameEntityView getEnchanting() {
|
||||||
return get(TrackableProperty.Enchanting);
|
return get(TrackableProperty.Enchanting);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import forge.game.Direction;
|
|||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.trackable.TrackableTypes;
|
|
||||||
import forge.trackable.TrackableTypes.TrackableType;
|
import forge.trackable.TrackableTypes.TrackableType;
|
||||||
|
|
||||||
public enum TrackableProperty {
|
public enum TrackableProperty {
|
||||||
@@ -45,6 +44,7 @@ public enum TrackableProperty {
|
|||||||
Enchanting(TrackableTypes.GameEntityViewType),
|
Enchanting(TrackableTypes.GameEntityViewType),
|
||||||
Fortifying(TrackableTypes.CardViewType),
|
Fortifying(TrackableTypes.CardViewType),
|
||||||
FortifiedBy(TrackableTypes.CardViewCollectionType),
|
FortifiedBy(TrackableTypes.CardViewCollectionType),
|
||||||
|
EncodedCards(TrackableTypes.CardViewCollectionType),
|
||||||
GainControlTargets(TrackableTypes.CardViewCollectionType),
|
GainControlTargets(TrackableTypes.CardViewCollectionType),
|
||||||
CloneOrigin(TrackableTypes.CardViewType),
|
CloneOrigin(TrackableTypes.CardViewType),
|
||||||
Cloner(TrackableTypes.StringType),
|
Cloner(TrackableTypes.StringType),
|
||||||
|
|||||||
@@ -557,6 +557,14 @@ public class CardDetailUtil {
|
|||||||
area.append("Haunting " + card.getHaunting());
|
area.append("Haunting " + card.getHaunting());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cipher
|
||||||
|
if (card.getEncodedCards() != null) {
|
||||||
|
if (area.length() != 0) {
|
||||||
|
area.append("\n");
|
||||||
|
}
|
||||||
|
area.append("Encoded: " + card.getEncodedCards());
|
||||||
|
}
|
||||||
|
|
||||||
// must block
|
// must block
|
||||||
if (card.getMustBlockCards() != null) {
|
if (card.getMustBlockCards() != null) {
|
||||||
if (area.length() != 0) {
|
if (area.length() != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user