mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Fixed card type displaying order (fixes #6055).
This commit is contained in:
parent
4006e9e909
commit
2788eab082
24 changed files with 106 additions and 141 deletions
|
@ -1,5 +1,14 @@
|
|||
package mage.client.dialog;
|
||||
|
||||
import java.awt.*;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.InternalFrameAdapter;
|
||||
import javax.swing.event.InternalFrameEvent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
|
@ -13,15 +22,6 @@ import mage.view.SimpleCardsView;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.InternalFrameAdapter;
|
||||
import javax.swing.event.InternalFrameEvent;
|
||||
import java.awt.*;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
this.setClosable(false);
|
||||
break;
|
||||
default:
|
||||
// no icon yet
|
||||
// no icon yet
|
||||
}
|
||||
this.setTitelBarToolTip(name);
|
||||
setGUISize();
|
||||
|
@ -174,13 +174,17 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
Set<String> cardTypesPresent = new LinkedHashSet<String>() {
|
||||
};
|
||||
for (CardView card : cardsView.values()) {
|
||||
Set<CardType> cardTypes = card.getCardTypes();
|
||||
Set<CardType> cardTypes = EnumSet.noneOf(CardType.class);
|
||||
cardTypes.addAll(card.getCardTypes());
|
||||
for (CardType cardType : cardTypes) {
|
||||
cardTypesPresent.add(cardType.toString());
|
||||
}
|
||||
}
|
||||
if (cardTypesPresent.isEmpty()) return 0;
|
||||
else return cardTypesPresent.size();
|
||||
if (cardTypesPresent.isEmpty()) {
|
||||
return 0;
|
||||
} else {
|
||||
return cardTypesPresent.size();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
package mage.client.game;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.GroupLayout.Alignment;
|
||||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.LineBorder;
|
||||
import mage.cards.decks.importer.DckDeckImporter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.SessionHandler;
|
||||
|
@ -15,6 +23,7 @@ import mage.client.util.gui.countryBox.CountryUtil;
|
|||
import mage.components.ImagePanel;
|
||||
import mage.components.ImagePanelStyle;
|
||||
import mage.constants.CardType;
|
||||
import static mage.constants.Constants.*;
|
||||
import mage.constants.ManaType;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
|
@ -23,17 +32,6 @@ import mage.utils.timer.PriorityTimer;
|
|||
import mage.view.*;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.GroupLayout.Alignment;
|
||||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.LineBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.*;
|
||||
|
||||
import static mage.constants.Constants.*;
|
||||
|
||||
/**
|
||||
* Enhanced player pane.
|
||||
*
|
||||
|
@ -42,7 +40,6 @@ import static mage.constants.Constants.*;
|
|||
public class PlayerPanelExt extends javax.swing.JPanel {
|
||||
|
||||
// TODO: *.form file was lost, panel must be reworks in designer
|
||||
|
||||
private UUID playerId;
|
||||
private UUID gameId;
|
||||
private PlayerView player;
|
||||
|
@ -612,7 +609,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
manaCountLabelW.addMouseListener(manaMouseAdapter);
|
||||
manaLabels.put(manaCountLabelW, ManaType.WHITE);l
|
||||
//*/
|
||||
|
||||
///*
|
||||
JLabel manaCountLabelW = new JLabel();
|
||||
manaCountLabelW.setToolTipText("White mana");
|
||||
|
@ -944,7 +940,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
Set<String> cardTypesPresent = new LinkedHashSet<String>() {
|
||||
};
|
||||
for (CardView card : cardsView.values()) {
|
||||
Set<CardType> cardTypes = card.getCardTypes();
|
||||
Set<CardType> cardTypes = EnumSet.noneOf(CardType.class);
|
||||
cardTypes.addAll(card.getCardTypes());
|
||||
for (CardType cardType : cardTypes) {
|
||||
cardTypesPresent.add(cardType.toString());
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package mage.view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
@ -29,7 +28,7 @@ public class AbilityView extends CardView {
|
|||
this.power = "";
|
||||
this.toughness = "";
|
||||
this.loyalty = "";
|
||||
this.cardTypes = EnumSet.noneOf(CardType.class);
|
||||
this.cardTypes = new ArrayList<CardType>();
|
||||
this.subTypes = new SubTypeList();
|
||||
this.superTypes = EnumSet.noneOf(SuperType.class);
|
||||
this.color = new ObjectColor();
|
||||
|
@ -45,5 +44,4 @@ public class AbilityView extends CardView {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package mage.view;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
|
@ -29,9 +31,6 @@ import mage.target.Targets;
|
|||
import mage.util.CardUtil;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
@ -55,7 +54,7 @@ public class CardView extends SimpleCardView {
|
|||
@Expose
|
||||
protected String loyalty = "";
|
||||
protected String startingLoyalty;
|
||||
protected Set<CardType> cardTypes;
|
||||
protected ArrayList<CardType> cardTypes;
|
||||
protected SubTypeList subTypes;
|
||||
protected Set<SuperType> superTypes;
|
||||
protected ObjectColor color;
|
||||
|
@ -151,7 +150,7 @@ public class CardView extends SimpleCardView {
|
|||
this.toughness = cardView.toughness;
|
||||
this.loyalty = cardView.loyalty;
|
||||
this.startingLoyalty = cardView.startingLoyalty;
|
||||
this.cardTypes = new HashSet<>(cardView.cardTypes);
|
||||
this.cardTypes = new ArrayList<>(cardView.cardTypes);
|
||||
this.subTypes = new SubTypeList(cardView.subTypes);
|
||||
this.superTypes = cardView.superTypes;
|
||||
|
||||
|
@ -213,8 +212,8 @@ public class CardView extends SimpleCardView {
|
|||
* @param card
|
||||
* @param game
|
||||
* @param controlled is the card view created for the card controller - used
|
||||
* for morph / face down cards to know which player may see information for
|
||||
* the card
|
||||
* for morph / face down cards to know which player may see information for
|
||||
* the card
|
||||
*/
|
||||
public CardView(Card card, Game game, boolean controlled) {
|
||||
this(card, game, controlled, false, false);
|
||||
|
@ -240,12 +239,12 @@ public class CardView extends SimpleCardView {
|
|||
/**
|
||||
* @param card
|
||||
* @param game
|
||||
* @param controlled is the card view created for the card controller - used
|
||||
* for morph / face down cards to know which player may see information for
|
||||
* the card
|
||||
* @param controlled is the card view created for the card controller - used
|
||||
* for morph / face down cards to know which player may see information for
|
||||
* the card
|
||||
* @param showFaceDownCard if true and the card is not on the battlefield,
|
||||
* also a face down card is shown in the view, face down cards will be shown
|
||||
* @param storeZone if true the card zone will be set in the zone attribute.
|
||||
* also a face down card is shown in the view, face down cards will be shown
|
||||
* @param storeZone if true the card zone will be set in the zone attribute.
|
||||
*/
|
||||
public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard, boolean storeZone) {
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null, card.getTokenDescriptor());
|
||||
|
@ -636,7 +635,7 @@ public class CardView extends SimpleCardView {
|
|||
this.toughness = "";
|
||||
this.loyalty = "";
|
||||
this.startingLoyalty = "";
|
||||
this.cardTypes = EnumSet.noneOf(CardType.class);
|
||||
this.cardTypes = new ArrayList<>();
|
||||
this.subTypes = new SubTypeList();
|
||||
this.superTypes = EnumSet.noneOf(SuperType.class);
|
||||
this.color = new ObjectColor();
|
||||
|
@ -764,7 +763,7 @@ public class CardView extends SimpleCardView {
|
|||
return startingLoyalty;
|
||||
}
|
||||
|
||||
public Set<CardType> getCardTypes() {
|
||||
public ArrayList<CardType> getCardTypes() {
|
||||
return cardTypes;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
|
@ -69,11 +66,8 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl {
|
|||
for (Card card : zEvent.getCards()) {
|
||||
if (card != null) {
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isLand()) {
|
||||
game.getState().setValue("usedOnTurn" + getControllerId() + getOriginalId(), game.getTurnNum());
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
@ -60,13 +59,9 @@ class DesecratedTombTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& zEvent.getCards() != null) {
|
||||
for (Card card : zEvent.getCards()) {
|
||||
if (card != null) {
|
||||
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -10,8 +11,6 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
@ -20,7 +19,8 @@ public final class ManaClash extends CardImpl {
|
|||
public ManaClash(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
|
||||
// You and target opponent each flip a coin. Mana Clash deals 1 damage to each player whose coin comes up tails. Repeat this process until both players' coins come up heads on the same flip.
|
||||
// You and target opponent each flip a coin. Mana Clash deals 1 damage to each player whose coin comes up tails.
|
||||
// Repeat this process until both players' coins come up heads on the same flip.
|
||||
this.getSpellAbility().addEffect(new ManaClashEffect());
|
||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
@ -61,10 +59,8 @@ class PedanticLearningTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isLand()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
|
@ -147,7 +145,7 @@ class PossibilityStormEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean sharesType(Card card, Set<CardType> cardTypes) {
|
||||
private boolean sharesType(Card card, ArrayList<CardType> cardTypes) {
|
||||
for (CardType type : card.getCardType()) {
|
||||
if (cardTypes.contains(type)) {
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -73,13 +71,9 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (zEvent != null && Zone.LIBRARY == zEvent.getFromZone() && Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
|
||||
for (Card card : zEvent.getCards()) {
|
||||
if (card != null) {
|
||||
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -29,7 +27,7 @@ import mage.target.common.TargetControlledPermanent;
|
|||
public final class TheGitrogMonster extends CardImpl {
|
||||
|
||||
public TheGitrogMonster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.FROG);
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
@ -79,12 +77,10 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl {
|
|||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||
if (zEvent != null && Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
|
||||
for (Card card : zEvent.getCards()) {
|
||||
if (card != null) {
|
||||
if (card != null) {
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isLand()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -11,10 +10,10 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
|||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
|
@ -94,10 +93,8 @@ class TurntimberSowerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
for (Card card : zEvent.getCards()) {
|
||||
if (card != null) {
|
||||
UUID cardOwnerId = card.getOwnerId();
|
||||
Set<CardType> cardType = card.getCardType();
|
||||
if (cardOwnerId != null
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isLand()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import mage.abilities.Abilities;
|
||||
|
@ -30,7 +31,7 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
void setName(String name);
|
||||
|
||||
Set<CardType> getCardType();
|
||||
ArrayList<CardType> getCardType();
|
||||
|
||||
SubTypeList getSubtype(Game game);
|
||||
|
||||
|
@ -41,6 +42,8 @@ public interface MageObject extends MageItem, Serializable {
|
|||
/**
|
||||
* For cards: return basic abilities (without dynamic added) For permanents:
|
||||
* return all abilities (dynamic ability inserts into permanent)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Abilities<Ability> getAbilities();
|
||||
|
||||
|
@ -201,7 +204,7 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
void setIsAllCreatureTypes(boolean value);
|
||||
|
||||
default void addCardTypes(Set<CardType> cardType) {
|
||||
default void addCardTypes(ArrayList<CardType> cardType) {
|
||||
getCardType().addAll(cardType);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage;
|
||||
|
||||
import java.util.*;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -21,8 +22,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.util.GameLog;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public abstract class MageObjectImpl implements MageObject {
|
||||
|
||||
protected UUID objectId;
|
||||
|
@ -32,7 +31,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
protected ObjectColor color;
|
||||
protected ObjectColor frameColor;
|
||||
protected FrameStyle frameStyle;
|
||||
protected Set<CardType> cardType = EnumSet.noneOf(CardType.class);
|
||||
protected ArrayList<CardType> cardType = new ArrayList<>();
|
||||
protected SubTypeList subtype = new SubTypeList();
|
||||
protected boolean isAllCreatureTypes;
|
||||
protected Set<SuperType> supertype = EnumSet.noneOf(SuperType.class);
|
||||
|
@ -112,7 +111,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return cardType;
|
||||
}
|
||||
|
||||
|
@ -329,7 +328,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
*/
|
||||
@Override
|
||||
public void removePTCDA() {
|
||||
for (Iterator<Ability> iter = this.getAbilities().iterator(); iter.hasNext(); ) {
|
||||
for (Iterator<Ability> iter = this.getAbilities().iterator(); iter.hasNext();) {
|
||||
Ability ability = iter.next();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (effect instanceof ContinuousEffect && ((ContinuousEffect) effect).getSublayer() == SubLayer.CharacteristicDefining_7a) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -8,8 +9,6 @@ import mage.constants.CardType;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
|
@ -21,7 +20,7 @@ public enum CardTypesInGraveyardCount implements DynamicValue {
|
|||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller != null) {
|
||||
EnumSet<CardType> foundCardTypes = EnumSet.noneOf(CardType.class);
|
||||
ArrayList<CardType> foundCardTypes = new ArrayList<>();
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
foundCardTypes.addAll(card.getCardType());
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package mage.cards.repository;
|
|||
import com.j256.ormlite.field.DataType;
|
||||
import com.j256.ormlite.field.DatabaseField;
|
||||
import com.j256.ormlite.table.DatabaseTable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
|
@ -15,9 +17,6 @@ import mage.util.CardUtil;
|
|||
import mage.util.SubTypeList;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
*/
|
||||
|
@ -289,8 +288,8 @@ public class CardInfo {
|
|||
return res;
|
||||
}
|
||||
|
||||
public final Set<CardType> getTypes() {
|
||||
Set<CardType> list = EnumSet.noneOf(CardType.class);
|
||||
public final ArrayList<CardType> getTypes() {
|
||||
ArrayList<CardType> list = new ArrayList<>();
|
||||
for (String type : this.types.split(SEPARATOR)) {
|
||||
try {
|
||||
list.add(CardType.valueOf(type));
|
||||
|
@ -300,7 +299,7 @@ public class CardInfo {
|
|||
return list;
|
||||
}
|
||||
|
||||
public final void setTypes(Set<CardType> types) {
|
||||
public final void setTypes(ArrayList<CardType> types) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (CardType item : types) {
|
||||
sb.append(item.name()).append(SEPARATOR);
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package mage.constants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import mage.MageObject;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
*/
|
||||
|
@ -63,7 +62,7 @@ public enum CardType {
|
|||
* @return
|
||||
*/
|
||||
public static CardType[] mergeTypes(CardType[] a, CardType[] b) {
|
||||
EnumSet<CardType> cardTypes = EnumSet.noneOf(CardType.class);
|
||||
ArrayList<CardType> cardTypes = new ArrayList<>();
|
||||
cardTypes.addAll(Arrays.asList(a));
|
||||
cardTypes.addAll(Arrays.asList(b));
|
||||
return cardTypes.toArray(new CardType[0]);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package mage.designations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
|
@ -19,11 +23,6 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.util.GameLog;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
@ -151,8 +150,8 @@ public abstract class Designation implements MageObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<CardType> getCardType() {
|
||||
return emptySet;
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package mage.game.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
|
@ -20,10 +24,6 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.util.GameLog;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Commander implements CommandObject {
|
||||
|
||||
private final Card sourceObject;
|
||||
|
@ -133,7 +133,7 @@ public class Commander implements CommandObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return sourceObject.getCardType();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package mage.game.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
|
@ -22,16 +26,12 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.util.GameLog;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public class Emblem implements CommandObject {
|
||||
|
||||
private static EnumSet<CardType> emptySet = EnumSet.noneOf(CardType.class);
|
||||
private static ArrayList<CardType> emptySet = new ArrayList<>();
|
||||
private static ObjectColor emptyColor = new ObjectColor();
|
||||
private static ManaCosts emptyCost = new ManaCostsImpl();
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class Emblem implements CommandObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return emptySet;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mage.game.command;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
|
@ -24,17 +29,12 @@ import mage.util.GameLog;
|
|||
import mage.util.RandomUtil;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
*/
|
||||
public class Plane implements CommandObject {
|
||||
|
||||
private static EnumSet<CardType> emptySet = EnumSet.noneOf(CardType.class);
|
||||
private static ArrayList<CardType> emptySet = new ArrayList<>();
|
||||
private static ObjectColor emptyColor = new ObjectColor();
|
||||
private static ManaCosts emptyCost = new ManaCostsImpl();
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class Plane implements CommandObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return emptySet;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ public final class TilonallisSummonerElementalToken extends TokenImpl {
|
|||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TilonallisSummonerElementalToken copy() {
|
||||
return new TilonallisSummonerElementalToken(this);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.game.stack;
|
||||
|
||||
import java.util.*;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
|
@ -31,8 +32,6 @@ import mage.players.Player;
|
|||
import mage.util.GameLog;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
@ -467,14 +466,14 @@ public class Spell extends StackObjImpl implements Card {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
if (faceDown) {
|
||||
EnumSet<CardType> cardTypes = EnumSet.noneOf(CardType.class);
|
||||
ArrayList<CardType> cardTypes = new ArrayList<>();
|
||||
cardTypes.add(CardType.CREATURE);
|
||||
return cardTypes;
|
||||
}
|
||||
if (this.getSpellAbility() instanceof BestowAbility) {
|
||||
EnumSet<CardType> cardTypes = EnumSet.noneOf(CardType.class);
|
||||
ArrayList<CardType> cardTypes = new ArrayList<>();
|
||||
cardTypes.addAll(card.getCardType());
|
||||
cardTypes.remove(CardType.CREATURE);
|
||||
return cardTypes;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package mage.game.stack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
|
@ -30,17 +34,12 @@ import mage.util.GameLog;
|
|||
import mage.util.SubTypeList;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class StackAbility extends StackObjImpl implements Ability {
|
||||
|
||||
private static EnumSet<CardType> emptyCardType = EnumSet.noneOf(CardType.class);
|
||||
private static ArrayList<CardType> emptyCardType = new ArrayList<>();
|
||||
private static List<String> emptyString = new ArrayList<>();
|
||||
private static ObjectColor emptyColor = new ObjectColor();
|
||||
private static ManaCosts<ManaCost> emptyCost = new ManaCostsImpl<>();
|
||||
|
@ -153,7 +152,7 @@ public class StackAbility extends StackObjImpl implements Ability {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<CardType> getCardType() {
|
||||
public ArrayList<CardType> getCardType() {
|
||||
return emptyCardType;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue