MCPcopy Create free account
hub / github.com/Card-Forge/forge / Card

Class Card

forge-game/src/main/java/forge/game/card/Card.java:87–8111  ·  view source on GitHub ↗

Card class. Can now be used as keys in Tree data structures. The comparison is based entirely on id. @author Forge @version $Id$

Source from the content-addressed store, hash-verified

85 * @version $Id$
86 */
87public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITranslatable {
88 private Game game;
89 private final IPaperCard paperCard;
90
91 private final Map<CardStateName, CardState> states = Maps.newEnumMap(CardStateName.class);
92 private CardState currentState;
93 private CardStateName currentStateName = CardStateName.Original;
94 private GamePieceType gamePieceType = GamePieceType.CARD;
95
96 private Zone castFrom;
97 private SpellAbility castSA;
98
99 // Hidden keywords won't be displayed on the card
100 // x=timestamp y=StaticAbility id
101 private final Table<Long, Long, List<String>> hiddenExtrinsicKeywords = TreeBasedTable.create();
102
103 // cards attached or otherwise linked to this card
104 private CardCollection hauntedBy, devouredCards, exploitedCards, delvedCards, imprintedCards,
105 exiledCards, encodedCards;
106 private CardCollection gainControlTargets, chosenCards;
107 private CardCollection mergedCards;
108 private Map<Long, CardCollection> mustBlockCards = Maps.newHashMap();
109 private List<Card> blockedThisTurn = Lists.newArrayList();
110 private List<Card> blockedByThisTurn = Lists.newArrayList();
111
112 private CardCollection untilLeavesBattlefield = new CardCollection();
113
114 // if this card is attached or linked to something, what card is it currently attached to
115 private Card encoding, cloneOrigin, haunting, effectSource, pairedWith, meldedWith;
116 private Card mergedTo;
117
118 private SpellAbility effectSourceAbility;
119 private SpellAbility tokenSpawningAbility;
120
121 private GameEntity entityAttachedTo;
122
123 // changes by AF animate and continuous static effects
124
125 // x=timestamp y=StaticAbility id
126 private final Table<Long, Long, ICardChangedType> changedCardTypesByText = TreeBasedTable.create(); // Layer 3
127 private final Table<Long, Long, ICardChangedType> changedCardTypesCharacterDefining = TreeBasedTable.create(); // Layer 4 CDA
128 private final Table<Long, Long, ICardChangedType> changedCardTypes = TreeBasedTable.create(); // Layer 4
129
130 private final Table<Long, Long, CardChangedName> changedCardNames = TreeBasedTable.create(); // Layer 3
131 private final Table<Long, Long, IKeywordsChange> changedCardKeywordsByText = TreeBasedTable.create(); // Layer 3 by Text Change
132 protected KeywordsChange changedCardKeywordsByWord = new KeywordsChange(ImmutableList.<KeywordInterface>of(), ImmutableList.<KeywordInterface>of(), false); // Layer 3 by Word Change
133 private final Table<Long, Long, KeywordsChange> changedCardKeywords = TreeBasedTable.create(); // Layer 6
134
135 // stores the keywords created by static abilities
136 private final Map<Triple<String, Long, Long>, KeywordInterface> storedKeywords = Maps.newHashMap();
137
138 // x=timestamp y=StaticAbility id
139 private final Table<Long, Long, CardTraitChanges> changedCardTraitsByText = TreeBasedTable.create(); // Layer 3 by Text Change
140 private final Table<Long, Long, ICardTraitChanges> changedCardTraits = TreeBasedTable.create(); // Layer 6
141
142 // stores the card traits created by static abilities
143 private final Table<StaticAbility, String, SpellAbility> storedSpellAbility = TreeBasedTable.create();
144 private final Table<StaticAbility, String, Trigger> storedTrigger = TreeBasedTable.create();

Callers

nothing calls this directly

Calls 3

ofMethod · 0.80
createMethod · 0.65
buildMethod · 0.45

Tested by

no test coverage detected