mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -424,10 +424,10 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public int compare(Entry<T, Integer> o1, Entry<T, Integer> o2) {
|
public int compare(Entry<T, Integer> o1, Entry<T, Integer> o2) {
|
||||||
return sorter.compare((Entry<InventoryItem, Integer>)o1, (Entry<InventoryItem, Integer>)o2);
|
return sorter.compare((Entry<InventoryItem, Integer>) o1, (Entry<InventoryItem, Integer>) o2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resort.
|
* Resort.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -67,9 +67,8 @@ public final class TableView<T extends InventoryItem> {
|
|||||||
/** The want unique. */
|
/** The want unique. */
|
||||||
private boolean wantUnique = false;
|
private boolean wantUnique = false;
|
||||||
|
|
||||||
|
|
||||||
private final Class<T> genericType;
|
private final Class<T> genericType;
|
||||||
|
|
||||||
// need this to allow users place its contents
|
// need this to allow users place its contents
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -128,7 +127,7 @@ public final class TableView<T extends InventoryItem> {
|
|||||||
public TableView(final String title, final boolean showStats, final boolean forceUnique, Class<T> cls) {
|
public TableView(final String title, final boolean showStats, final boolean forceUnique, Class<T> cls) {
|
||||||
// components
|
// components
|
||||||
genericType = cls;
|
genericType = cls;
|
||||||
|
|
||||||
final Color gray = new Color(148, 145, 140);
|
final Color gray = new Color(148, 145, 140);
|
||||||
final TitledBorder titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, gray), title);
|
final TitledBorder titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, gray), title);
|
||||||
|
|
||||||
@@ -277,7 +276,6 @@ public final class TableView<T extends InventoryItem> {
|
|||||||
this.setDeckImpl(pool);
|
this.setDeckImpl(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* setDeckImpl.
|
* setDeckImpl.
|
||||||
|
|||||||
@@ -85,11 +85,12 @@ public class PreconDeck implements InventoryItemFromSet {
|
|||||||
String setProxy = "n/a";
|
String setProxy = "n/a";
|
||||||
|
|
||||||
FileSection kv = FileSection.parse(sections.get("metadata"), "=");
|
FileSection kv = FileSection.parse(sections.get("metadata"), "=");
|
||||||
|
|
||||||
imageFilename = kv.get("Image");
|
imageFilename = kv.get("Image");
|
||||||
description = kv.get("Description");
|
description = kv.get("Description");
|
||||||
if( AllZone.getEditions().getEditionByCode(kv.get("set").toUpperCase()) != null )
|
if (AllZone.getEditions().getEditionByCode(kv.get("set").toUpperCase()) != null) {
|
||||||
{ setProxy = kv.get("set"); }
|
setProxy = kv.get("set");
|
||||||
|
}
|
||||||
|
|
||||||
this.set = setProxy;
|
this.set = setProxy;
|
||||||
this.recommendedDeals = new SellRules(sections.get("shop"));
|
this.recommendedDeals = new SellRules(sections.get("shop"));
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ public enum FModel {
|
|||||||
private final QuestEventManager questEventManager;
|
private final QuestEventManager questEventManager;
|
||||||
private final GameState gameState;
|
private final GameState gameState;
|
||||||
private final FMatchState matchState;
|
private final FMatchState matchState;
|
||||||
|
|
||||||
// have to implement lazy initialization - at the moment of FModel.ctor() CardDb is not ready yet.
|
// have to implement lazy initialization - at the moment of FModel.ctor() CardDb is not ready yet.
|
||||||
private CardCollections decks;
|
private CardCollections decks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -310,12 +310,13 @@ public enum FModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all player's decks for constructed, sealed and whatever
|
* Returns all player's decks for constructed, sealed and whatever.
|
||||||
* @return {@link forge.decks.CardCollections}
|
* @return {@link forge.decks.CardCollections}
|
||||||
*/
|
*/
|
||||||
public final CardCollections getDecks() {
|
public final CardCollections getDecks() {
|
||||||
if (decks == null)
|
if (decks == null) {
|
||||||
this.decks = new CardCollections(ForgeProps.getFile(NewConstants.NEW_DECKS));
|
this.decks = new CardCollections(ForgeProps.getFile(NewConstants.NEW_DECKS));
|
||||||
|
}
|
||||||
return decks;
|
return decks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SellRules {
|
|||||||
if (null == questShop || questShop.isEmpty()) {
|
if (null == questShop || questShop.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSection section = FileSection.parse(questShop, "=");
|
FileSection section = FileSection.parse(questShop, "=");
|
||||||
minWins = section.getInt("WinsToUnlock");
|
minWins = section.getInt("WinsToUnlock");
|
||||||
cost = section.getInt("Credits", 250);
|
cost = section.getInt("Credits", 250);
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public final class QuestData {
|
|||||||
// Decks collected by player
|
// Decks collected by player
|
||||||
/** The my decks. */
|
/** The my decks. */
|
||||||
private final HashMap<String, Deck> myDecks = new HashMap<String, Deck>();
|
private final HashMap<String, Deck> myDecks = new HashMap<String, Deck>();
|
||||||
|
|
||||||
private transient IFolderMap<Deck> decks;
|
private transient IFolderMap<Deck> decks;
|
||||||
|
|
||||||
// Cards associated with quest
|
// Cards associated with quest
|
||||||
@@ -199,8 +199,9 @@ public final class QuestData {
|
|||||||
this.initTransients();
|
this.initTransients();
|
||||||
this.setName(s0);
|
this.setName(s0);
|
||||||
|
|
||||||
QuestPreferences prefs = Singletons.getModel().getQuestPreferences();
|
QuestPreferences prefs = Singletons.getModel().getQuestPreferences();
|
||||||
ItemPoolView<CardPrinted> lands = QuestUtilCards.generateBasicLands( prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS), prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS) );
|
ItemPoolView<CardPrinted> lands = QuestUtilCards.generateBasicLands(prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS),
|
||||||
|
prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS));
|
||||||
this.getCardPool().addAll(lands);
|
this.getCardPool().addAll(lands);
|
||||||
this.randomizeOpponents();
|
this.randomizeOpponents();
|
||||||
}
|
}
|
||||||
@@ -210,8 +211,7 @@ public final class QuestData {
|
|||||||
this.decks = new QuestDeckMap(myDecks);
|
this.decks = new QuestDeckMap(myDecks);
|
||||||
this.myCards = new QuestUtilCards(this);
|
this.myCards = new QuestUtilCards(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// to avoid NPE some pools will be created here if they are null
|
// to avoid NPE some pools will be created here if they are null
|
||||||
if (null == this.getNewCardList()) {
|
if (null == this.getNewCardList()) {
|
||||||
this.setNewCardList(new ItemPool<InventoryItem>(InventoryItem.class));
|
this.setNewCardList(new ItemPool<InventoryItem>(InventoryItem.class));
|
||||||
|
|||||||
@@ -14,15 +14,14 @@ import forge.util.IFolderMap;
|
|||||||
*/
|
*/
|
||||||
public class QuestDeckMap implements IFolderMap<Deck> {
|
public class QuestDeckMap implements IFolderMap<Deck> {
|
||||||
|
|
||||||
|
|
||||||
public QuestDeckMap() {
|
public QuestDeckMap() {
|
||||||
map = new HashMap<String,Deck>();
|
map = new HashMap<String, Deck>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuestDeckMap(Map<String,Deck> inMap) {
|
public QuestDeckMap(Map<String, Deck> inMap) {
|
||||||
map = inMap;
|
map = inMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Map<String, Deck> map;
|
private final Map<String, Deck> map;
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.util.IFolderMapView#get(java.lang.String)
|
* @see forge.util.IFolderMapView#get(java.lang.String)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class QuestEventManager {
|
|||||||
|
|
||||||
/** The very hard a iduels. */
|
/** The very hard a iduels. */
|
||||||
private final List<QuestDuel> veryHardAIduels = new ArrayList<QuestDuel>();
|
private final List<QuestDuel> veryHardAIduels = new ArrayList<QuestDuel>();
|
||||||
|
|
||||||
/** The all duels. */
|
/** The all duels. */
|
||||||
private List<QuestDuel> allDuels = null;
|
private List<QuestDuel> allDuels = null;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import javax.swing.JOptionPane;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class treats every line of a given file as a source for a named object.
|
* This class treats every line of a given file as a source for a named object.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class StorageReaderFile<T extends IHasName> implements IItemReader<T> {
|
public abstract class StorageReaderFile<T extends IHasName> implements IItemReader<T> {
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class treats every file in the given folder as a source for a named object.
|
* This class treats every file in the given folder as a source for a named object.
|
||||||
* The descendant should implement read method to deserialize a single item.
|
* The descendant should implement read method to deserialize a single item.
|
||||||
* So that readAll will return a map of Name => Object as read from disk
|
* So that readAll will return a map of Name => Object as read from disk
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -102,7 +102,7 @@ public abstract class StorageReaderFolder<T extends IHasName> implements IItemRe
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the object from file
|
* Read the object from file.
|
||||||
* @param file
|
* @param file
|
||||||
* @return the object deserialized by inherited class
|
* @return the object deserialized by inherited class
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ public class QuestWinLoseHandler extends ControlWinLose {
|
|||||||
*/
|
*/
|
||||||
private void awardBooster() {
|
private void awardBooster() {
|
||||||
final GameFormat[] emptyFormatArray = {};
|
final GameFormat[] emptyFormatArray = {};
|
||||||
final GameFormat[] formats = AllZone.getFormats().getFormats().toArray(emptyFormatArray) ;
|
final GameFormat[] formats = AllZone.getFormats().getFormats().toArray(emptyFormatArray);
|
||||||
final ListChooser<GameFormat> ch = new ListChooser<GameFormat>("Choose bonus booster format", 1, formats);
|
final ListChooser<GameFormat> ch = new ListChooser<GameFormat>("Choose bonus booster format", 1, formats);
|
||||||
|
|
||||||
String prefferedFormat = Singletons.getModel().getQuestPreferences().getPreference(QPref.BOOSTER_FORMAT);
|
String prefferedFormat = Singletons.getModel().getQuestPreferences().getPreference(QPref.BOOSTER_FORMAT);
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ public class DeckLister extends JPanel {
|
|||||||
if (n == JOptionPane.NO_OPTION) {
|
if (n == JOptionPane.NO_OPTION) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final CardCollections deckManager = Singletons.getModel().getDecks();
|
final CardCollections deckManager = Singletons.getModel().getDecks();
|
||||||
|
|
||||||
if (gametype.equals(GameType.Draft)) {
|
if (gametype.equals(GameType.Draft)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user