mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
missed 2 hashsets to enumsets
This commit is contained in:
parent
372584f7ad
commit
a0930e3379
4 changed files with 34 additions and 31 deletions
|
@ -44,6 +44,7 @@ import javax.swing.ImageIcon;
|
|||
import javax.swing.SwingUtilities;
|
||||
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;
|
||||
|
@ -58,7 +59,6 @@ import org.apache.log4j.Logger;
|
|||
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class CardInfoWindowDialog extends MageDialog {
|
||||
|
@ -203,7 +203,8 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
}
|
||||
|
||||
private int qtyCardTypes(mage.view.CardsView cardsView) {
|
||||
Set<String> cardTypesPresent = new LinkedHashSet<String>() {};
|
||||
Set<String> cardTypesPresent = new LinkedHashSet<String>() {
|
||||
};
|
||||
for (CardView card : cardsView.values()) {
|
||||
Set<CardType> cardTypes = card.getCardTypes();
|
||||
for (CardType cardType : cardTypes) {
|
||||
|
@ -213,6 +214,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
if (cardTypesPresent.isEmpty()) return 0;
|
||||
else return cardTypesPresent.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
|
||||
package mage.view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.constants.CardType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class AbilityView extends CardView {
|
||||
|
@ -55,7 +55,7 @@ public class AbilityView extends CardView {
|
|||
this.power = "";
|
||||
this.toughness = "";
|
||||
this.loyalty = "";
|
||||
this.cardTypes = new HashSet<>();
|
||||
this.cardTypes = EnumSet.noneOf(CardType.class);
|
||||
this.subTypes = new ArrayList<>();
|
||||
this.superTypes = new ArrayList<>();
|
||||
this.color = new ObjectColor();
|
||||
|
|
|
@ -70,7 +70,7 @@ public class CardView extends SimpleCardView {
|
|||
protected String toughness;
|
||||
protected String loyalty;
|
||||
protected String startingLoyalty;
|
||||
protected Set<CardType> cardTypes;
|
||||
protected EnumSet<CardType> cardTypes;
|
||||
protected List<String> subTypes;
|
||||
protected List<String> superTypes;
|
||||
protected ObjectColor color;
|
||||
|
@ -518,7 +518,7 @@ public class CardView extends SimpleCardView {
|
|||
this.toughness = "";
|
||||
this.loyalty = "";
|
||||
this.startingLoyalty = "";
|
||||
this.cardTypes = new HashSet<>();
|
||||
this.cardTypes = EnumSet.noneOf(CardType.class);
|
||||
this.subTypes = new ArrayList<>();
|
||||
this.superTypes = new ArrayList<>();
|
||||
this.color = new ObjectColor();
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
@ -165,7 +166,7 @@ class PossibilityStormEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean sharesType(Card card, Set<CardType> cardTypes) {
|
||||
private boolean sharesType(Card card, EnumSet<CardType> cardTypes) {
|
||||
for (CardType type : card.getCardType()) {
|
||||
if (cardTypes.contains(type)) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue