mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Checkstyle and Java warnings cleanup in ReadDraftBoosterPack.java
This commit is contained in:
@@ -2,7 +2,6 @@ package forge;
|
|||||||
|
|
||||||
|
|
||||||
import forge.card.CardRules;
|
import forge.card.CardRules;
|
||||||
import forge.card.CardRules.Predicates;
|
|
||||||
import forge.card.CardDb;
|
import forge.card.CardDb;
|
||||||
import forge.card.CardPool;
|
import forge.card.CardPool;
|
||||||
import forge.card.CardPoolView;
|
import forge.card.CardPoolView;
|
||||||
@@ -29,8 +28,8 @@ import net.slightlymagic.maxmtg.Predicate;
|
|||||||
*/
|
*/
|
||||||
public class ReadDraftBoosterPack implements NewConstants {
|
public class ReadDraftBoosterPack implements NewConstants {
|
||||||
|
|
||||||
/** Constant <code>comment="//"</code> */
|
/** Constant <code>comment="//"</code>. */
|
||||||
final private static String comment = "//";
|
private static final String comment = "//";
|
||||||
|
|
||||||
private List<CardPrinted> commonCreatureList = new ArrayList<CardPrinted>();
|
private List<CardPrinted> commonCreatureList = new ArrayList<CardPrinted>();
|
||||||
private List<CardPrinted> commonNonCreatureList = new ArrayList<CardPrinted>();
|
private List<CardPrinted> commonNonCreatureList = new ArrayList<CardPrinted>();
|
||||||
@@ -53,11 +52,12 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
addBasicLands(list, 20);
|
addBasicLands(list, 20);
|
||||||
addBasicSnowLands(list, 20);
|
addBasicSnowLands(list, 20);
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++) {
|
||||||
list.add(CardDb.instance().getCard("Terramorphic Expanse", "M10"));
|
list.add(CardDb.instance().getCard("Terramorphic Expanse", "M10"));
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}//getBoosterPack5()
|
} //getBoosterPack5()
|
||||||
|
|
||||||
public static final void addBasicLands(final CardPool pool, final int count) {
|
public static final void addBasicLands(final CardPool pool, final int count) {
|
||||||
CardDb db = CardDb.instance();
|
CardDb db = CardDb.instance();
|
||||||
@@ -81,7 +81,7 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
*
|
*
|
||||||
* @return a {@link forge.CardList} object.
|
* @return a {@link forge.CardList} object.
|
||||||
*/
|
*/
|
||||||
public CardPoolView getBoosterPack() {
|
public final CardPoolView getBoosterPack() {
|
||||||
CardPool pack = new CardPool();
|
CardPool pack = new CardPool();
|
||||||
|
|
||||||
pack.add(getRandomCard(rareList));
|
pack.add(getRandomCard(rareList));
|
||||||
@@ -109,7 +109,7 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//return CardList of 5 or 6 cards, one for each color and maybe an artifact
|
//return CardList of 5 or 6 cards, one for each color and maybe an artifact
|
||||||
private List<CardPrinted> getVariety(List<CardPrinted> in) {
|
private List<CardPrinted> getVariety(final List<CardPrinted> in) {
|
||||||
List<CardPrinted> out = new ArrayList<CardPrinted>();
|
List<CardPrinted> out = new ArrayList<CardPrinted>();
|
||||||
Collections.shuffle(in, MyRandom.random);
|
Collections.shuffle(in, MyRandom.random);
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}//getVariety()
|
} //getVariety()
|
||||||
|
|
||||||
private static CardPrinted findColor(final List<CardPrinted> in, final int color) {
|
private static CardPrinted findColor(final List<CardPrinted> in, final int color) {
|
||||||
Predicate<CardRules> filter = null;
|
Predicate<CardRules> filter = null;
|
||||||
@@ -144,7 +144,7 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
}
|
}
|
||||||
int index = MyRandom.random.nextInt(list.size());
|
int index = MyRandom.random.nextInt(list.size());
|
||||||
return list.get(index);
|
return list.get(index);
|
||||||
}//getRandomCard()
|
} //getRandomCard()
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +163,7 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
CardRules.Predicates.Presets.isCreature.split(commonList, CardPrinted.fnGetRules,
|
CardRules.Predicates.Presets.isCreature.split(commonList, CardPrinted.fnGetRules,
|
||||||
commonCreatureList, commonNonCreatureList);
|
commonCreatureList, commonNonCreatureList);
|
||||||
|
|
||||||
}//setup()
|
} //setup()
|
||||||
|
|
||||||
private List<String> readFile(final File file) {
|
private List<String> readFile(final File file) {
|
||||||
List<String> cardList = new ArrayList<String>();
|
List<String> cardList = new ArrayList<String>();
|
||||||
@@ -188,7 +188,5 @@ public class ReadDraftBoosterPack implements NewConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return cardList;
|
return cardList;
|
||||||
}//readFile()
|
} //readFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user