mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
Move Booster Box to Editions File
This commit is contained in:
@@ -149,6 +149,7 @@ public class StaticData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Remove these in favor of them being associated to the Edition
|
||||||
/** @return {@link forge.util.storage.IStorage}<{@link forge.item.SealedProduct.Template}> */
|
/** @return {@link forge.util.storage.IStorage}<{@link forge.item.SealedProduct.Template}> */
|
||||||
public IStorage<FatPack.Template> getFatPacks() {
|
public IStorage<FatPack.Template> getFatPacks() {
|
||||||
if (fatPacks == null)
|
if (fatPacks == null)
|
||||||
@@ -156,12 +157,6 @@ public class StaticData {
|
|||||||
return fatPacks;
|
return fatPacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IStorage<BoosterBox.Template> getBoosterBoxes() {
|
|
||||||
if (boosterBoxes == null)
|
|
||||||
boosterBoxes = new StorageBase<>("Booster boxes", new BoosterBox.Template.Reader(blockDataFolder + "boosterboxes.txt"));
|
|
||||||
return boosterBoxes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return {@link forge.util.storage.IStorage}<{@link forge.item.SealedProduct.Template}> */
|
/** @return {@link forge.util.storage.IStorage}<{@link forge.item.SealedProduct.Template}> */
|
||||||
public final IStorage<SealedProduct.Template> getTournamentPacks() {
|
public final IStorage<SealedProduct.Template> getTournamentPacks() {
|
||||||
if (tournaments == null)
|
if (tournaments == null)
|
||||||
|
|||||||
@@ -143,20 +143,26 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
|||||||
private Type type;
|
private Type type;
|
||||||
private String name;
|
private String name;
|
||||||
private String alias = null;
|
private String alias = null;
|
||||||
private String prerelease = null;
|
|
||||||
private boolean whiteBorder = false;
|
private boolean whiteBorder = false;
|
||||||
|
|
||||||
|
// SealedProduct
|
||||||
|
private String prerelease = null;
|
||||||
|
private int boosterBoxCount = 36;
|
||||||
|
|
||||||
|
// Booster/draft info
|
||||||
|
private boolean smallSetOverride = false;
|
||||||
|
private boolean foilAlwaysInCommonSlot = false;
|
||||||
private FoilType foilType = FoilType.NOT_SUPPORTED;
|
private FoilType foilType = FoilType.NOT_SUPPORTED;
|
||||||
private double foilChanceInBooster = 0;
|
private double foilChanceInBooster = 0;
|
||||||
private boolean foilAlwaysInCommonSlot = false;
|
|
||||||
private double chanceReplaceCommonWith = 0;
|
private double chanceReplaceCommonWith = 0;
|
||||||
private String slotReplaceCommonWith = "Common";
|
private String slotReplaceCommonWith = "Common";
|
||||||
private String additionalSheetForFoils = "";
|
private String additionalSheetForFoils = "";
|
||||||
private String additionalUnlockSet = "";
|
private String additionalUnlockSet = "";
|
||||||
private boolean smallSetOverride = false;
|
|
||||||
private String boosterMustContain = "";
|
private String boosterMustContain = "";
|
||||||
private String boosterReplaceSlotFromPrintSheet = "";
|
private String boosterReplaceSlotFromPrintSheet = "";
|
||||||
private String[] chaosDraftThemes = new String[0];
|
|
||||||
private String doublePickDuringDraft = "";
|
private String doublePickDuringDraft = "";
|
||||||
|
private String[] chaosDraftThemes = new String[0];
|
||||||
|
|
||||||
private final ListMultimap<String, CardInSet> cardMap;
|
private final ListMultimap<String, CardInSet> cardMap;
|
||||||
private final Map<String, Integer> tokenNormalized;
|
private final Map<String, Integer> tokenNormalized;
|
||||||
// custom print sheets that will be loaded lazily
|
// custom print sheets that will be loaded lazily
|
||||||
@@ -220,7 +226,10 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
|||||||
public Type getType() { return type; }
|
public Type getType() { return type; }
|
||||||
public String getName() { return name; }
|
public String getName() { return name; }
|
||||||
public String getAlias() { return alias; }
|
public String getAlias() { return alias; }
|
||||||
|
|
||||||
public String getPrerelease() { return prerelease; }
|
public String getPrerelease() { return prerelease; }
|
||||||
|
public int getBoosterBoxCount() { return boosterBoxCount; }
|
||||||
|
|
||||||
public FoilType getFoilType() { return foilType; }
|
public FoilType getFoilType() { return foilType; }
|
||||||
public double getFoilChanceInBooster() { return foilChanceInBooster; }
|
public double getFoilChanceInBooster() { return foilChanceInBooster; }
|
||||||
public boolean getFoilAlwaysInCommonSlot() { return foilAlwaysInCommonSlot; }
|
public boolean getFoilAlwaysInCommonSlot() { return foilAlwaysInCommonSlot; }
|
||||||
@@ -448,6 +457,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
|||||||
}
|
}
|
||||||
res.type = enumType;
|
res.type = enumType;
|
||||||
res.prerelease = section.get("Prerelease", null);
|
res.prerelease = section.get("Prerelease", null);
|
||||||
|
res.boosterBoxCount = Integer.parseInt(section.get("BoosterBox", "36"));
|
||||||
|
|
||||||
switch(section.get("foil", "newstyle").toLowerCase()) {
|
switch(section.get("foil", "newstyle").toLowerCase()) {
|
||||||
case "notsupported":
|
case "notsupported":
|
||||||
@@ -671,7 +681,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
|||||||
private static class CanMakeBoosterBox implements Predicate<CardEdition> {
|
private static class CanMakeBoosterBox implements Predicate<CardEdition> {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final CardEdition subject) {
|
public boolean apply(final CardEdition subject) {
|
||||||
return StaticData.instance().getBoosterBoxes().contains(subject.getCode());
|
return subject.getBoosterBoxCount() > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ public class BoosterBox extends BoxedProduct {
|
|||||||
public static final Function<CardEdition, BoosterBox> FN_FROM_SET = new Function<CardEdition, BoosterBox>() {
|
public static final Function<CardEdition, BoosterBox> FN_FROM_SET = new Function<CardEdition, BoosterBox>() {
|
||||||
@Override
|
@Override
|
||||||
public BoosterBox apply(final CardEdition arg1) {
|
public BoosterBox apply(final CardEdition arg1) {
|
||||||
BoosterBox.Template d = StaticData.instance().getBoosterBoxes().get(arg1.getCode());
|
if (arg1.getBoosterBoxCount() <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
BoosterBox.Template d = new Template(arg1);
|
||||||
if (d == null) { return null; }
|
if (d == null) { return null; }
|
||||||
return new BoosterBox(arg1.getName(), d, d.cntBoosters);
|
return new BoosterBox(arg1.getName(), d, d.cntBoosters);
|
||||||
}
|
}
|
||||||
@@ -72,40 +75,13 @@ public class BoosterBox extends BoxedProduct {
|
|||||||
public static class Template extends SealedProduct.Template {
|
public static class Template extends SealedProduct.Template {
|
||||||
private final int cntBoosters;
|
private final int cntBoosters;
|
||||||
|
|
||||||
|
|
||||||
public int getCntBoosters() { return cntBoosters; }
|
public int getCntBoosters() { return cntBoosters; }
|
||||||
|
|
||||||
private Template(String edition, int boosters, Iterable<Pair<String, Integer>> itrSlots)
|
private Template(CardEdition edition) {
|
||||||
{
|
super(edition.getCode(), new ArrayList<>());
|
||||||
super(edition, itrSlots);
|
cntBoosters = edition.getBoosterBoxCount();
|
||||||
cntBoosters = boosters;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Reader extends StorageReaderFile<Template> {
|
|
||||||
public Reader(String pathname) {
|
|
||||||
super(pathname, FN_GET_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Template read(String line, int i) {
|
|
||||||
String[] headAndData = TextUtil.split(line, ':', 2);
|
|
||||||
final String edition = headAndData[0];
|
|
||||||
final String[] data = TextUtil.splitWithParenthesis(headAndData[1], ',');
|
|
||||||
int nBoosters = 6;
|
|
||||||
|
|
||||||
List<Pair<String, Integer>> slots = new ArrayList<>();
|
|
||||||
for(String slotDesc : data) {
|
|
||||||
String[] kv = TextUtil.split(slotDesc, ' ', 2);
|
|
||||||
if (kv[1].startsWith("Booster"))
|
|
||||||
nBoosters = Integer.parseInt(kv[0]);
|
|
||||||
else
|
|
||||||
slots.add(ImmutablePair.of(kv[1], Integer.parseInt(kv[0])));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new BoosterBox.Template(edition, nBoosters, slots);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (0 >= cntBoosters) {
|
if (0 >= cntBoosters) {
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
LEA: 36 Boosters
|
|
||||||
LEB: 36 Boosters
|
|
||||||
2ED: 36 Boosters
|
|
||||||
ARN: 60 Boosters
|
|
||||||
3ED: 36 Boosters
|
|
||||||
ATQ: 60 Boosters
|
|
||||||
LEG: 36 Boosters
|
|
||||||
DRK: 60 Boosters
|
|
||||||
FEM: 60 Boosters
|
|
||||||
4ED: 36 Boosters
|
|
||||||
CHR: 45 Boosters
|
|
||||||
HML: 60 Boosters
|
|
||||||
ICE: 36 Boosters
|
|
||||||
ALL: 45 Boosters
|
|
||||||
MIR: 36 Boosters
|
|
||||||
VIS: 36 Boosters
|
|
||||||
5ED: 36 Boosters
|
|
||||||
WTH: 36 Boosters
|
|
||||||
TMP: 36 Boosters
|
|
||||||
STH: 36 Boosters
|
|
||||||
EXO: 36 Boosters
|
|
||||||
USG: 36 Boosters
|
|
||||||
ULG: 36 Boosters
|
|
||||||
6ED: 36 Boosters
|
|
||||||
UDS: 36 Boosters
|
|
||||||
MMQ: 36 Boosters
|
|
||||||
NMS: 36 Boosters
|
|
||||||
PCY: 36 Boosters
|
|
||||||
INV: 36 Boosters
|
|
||||||
PLS: 36 Boosters
|
|
||||||
7ED: 36 Boosters
|
|
||||||
APC: 36 Boosters
|
|
||||||
ODY: 36 Boosters
|
|
||||||
TOR: 36 Boosters
|
|
||||||
JUD: 36 Boosters
|
|
||||||
ONS: 36 Boosters
|
|
||||||
LGN: 36 Boosters
|
|
||||||
SCG: 36 Boosters
|
|
||||||
8ED: 36 Boosters
|
|
||||||
MRD: 36 Boosters
|
|
||||||
DST: 36 Boosters
|
|
||||||
5DN: 36 Boosters
|
|
||||||
CHK: 36 Boosters
|
|
||||||
BOK: 36 Boosters
|
|
||||||
SOK: 36 Boosters
|
|
||||||
9ED: 36 Boosters
|
|
||||||
RAV: 36 Boosters
|
|
||||||
GPT: 36 Boosters
|
|
||||||
DIS: 36 Boosters
|
|
||||||
CSP: 36 Boosters
|
|
||||||
TSP: 36 Boosters
|
|
||||||
PLC: 36 Boosters
|
|
||||||
FUT: 36 Boosters
|
|
||||||
10E: 36 Boosters
|
|
||||||
LRW: 36 Boosters
|
|
||||||
MOR: 36 Boosters
|
|
||||||
SHM: 36 Boosters
|
|
||||||
EVE: 36 Boosters
|
|
||||||
ALA: 36 Boosters
|
|
||||||
CFX: 36 Boosters
|
|
||||||
ARB: 36 Boosters
|
|
||||||
M10: 36 Boosters
|
|
||||||
ZEN: 36 Boosters
|
|
||||||
WWK: 36 Boosters
|
|
||||||
ROE: 36 Boosters
|
|
||||||
M11: 36 Boosters
|
|
||||||
SOM: 36 Boosters
|
|
||||||
MBS: 36 Boosters
|
|
||||||
NPH: 36 Boosters
|
|
||||||
M12: 36 Boosters
|
|
||||||
ISD: 36 Boosters
|
|
||||||
DKA: 36 Boosters
|
|
||||||
AVR: 36 Boosters
|
|
||||||
M13: 36 Boosters
|
|
||||||
RTR: 36 Boosters
|
|
||||||
GTC: 36 Boosters
|
|
||||||
DGM: 36 Boosters
|
|
||||||
MMA: 24 Boosters
|
|
||||||
M14: 36 Boosters
|
|
||||||
THS: 36 Boosters
|
|
||||||
CNS: 36 Boosters
|
|
||||||
BNG: 36 Boosters
|
|
||||||
JOU: 36 Boosters
|
|
||||||
M15: 36 Boosters
|
|
||||||
KTK: 36 Boosters
|
|
||||||
FRF: 36 Boosters
|
|
||||||
DTK: 36 Boosters
|
|
||||||
MM2: 24 Boosters
|
|
||||||
ORI: 36 Boosters
|
|
||||||
BFZ: 36 Boosters
|
|
||||||
OGW: 36 Boosters
|
|
||||||
SOI: 36 Boosters
|
|
||||||
EMN: 36 Boosters
|
|
||||||
CN2: 36 Boosters
|
|
||||||
KLD: 36 Boosters
|
|
||||||
AER: 36 Boosters
|
|
||||||
MM3: 24 Boosters
|
|
||||||
AKH: 36 Boosters
|
|
||||||
HOU: 36 Boosters
|
|
||||||
XLN: 36 Boosters
|
|
||||||
RIX: 36 Boosters
|
|
||||||
A25: 24 Boosters
|
|
||||||
DOM: 36 Boosters
|
|
||||||
BBD: 36 Boosters
|
|
||||||
M19: 36 Boosters
|
|
||||||
GRN: 36 Boosters
|
|
||||||
UMA: 24 Boosters
|
|
||||||
RNA: 36 Boosters
|
|
||||||
WAR: 36 Boosters
|
|
||||||
MH1: 36 Boosters
|
|
||||||
M20: 36 Boosters
|
|
||||||
ELD: 36 Boosters
|
|
||||||
THB: 36 Boosters
|
|
||||||
MB1: 24 Boosters
|
|
||||||
IKO: 36 Boosters
|
|
||||||
M21: 36 Boosters
|
|
||||||
ZNR: 36 Boosters
|
|
||||||
KHM: 36 Boosters
|
|
||||||
@@ -7,6 +7,7 @@ MciCode=ai
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=8 Common, 3 Uncommon, 1 Rare
|
Booster=8 Common, 3 Uncommon, 1 Rare
|
||||||
|
BoosterBox=45
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=aq
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=6 Common, 2 UncommonRare
|
Booster=6 Common, 2 UncommonRare
|
||||||
|
BoosterBox=60
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=an
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=6 Common, 2 UncommonRare
|
Booster=6 Common, 2 UncommonRare
|
||||||
|
BoosterBox=60
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Type=Reprint
|
|||||||
Border=White
|
Border=White
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=9 Common, 3 UncommonRare
|
Booster=9 Common, 3 UncommonRare
|
||||||
|
BoosterBox=45
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Code2=COM
|
|||||||
Alias=CMD
|
Alias=CMD
|
||||||
MciCode=cmd
|
MciCode=cmd
|
||||||
Type=Other
|
Type=Other
|
||||||
|
BoosterBox=0
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
39 C AEthersnipe
|
39 C AEthersnipe
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=fe
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=5 Common, 2 Uncommon, 1 Rare
|
Booster=5 Common, 2 Uncommon, 1 Rare
|
||||||
|
BoosterBox=60
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=hl
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=6 Common, 2 UncommonRare
|
Booster=6 Common, 2 UncommonRare
|
||||||
|
BoosterBox=60
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ MciCode=a25
|
|||||||
Type=Reprint
|
Type=Reprint
|
||||||
BoosterCovers=3
|
BoosterCovers=3
|
||||||
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
||||||
|
BoosterBox=24
|
||||||
FoilChanceInBooster=100
|
FoilChanceInBooster=100
|
||||||
ChaosDraftThemes=MASTERS_SET
|
ChaosDraftThemes=MASTERS_SET
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=mh1
|
|||||||
Type=Other
|
Type=Other
|
||||||
BoosterCovers=5
|
BoosterCovers=5
|
||||||
Booster=10 Common:!fromSheet("MH1 Secret Cards"), 3 Uncommon:!fromSheet("MH1 Secret Cards"), 1 RareMythic:!fromSheet("MH1 Secret Cards"), 1 fromSheet("MH1 Lands")
|
Booster=10 Common:!fromSheet("MH1 Secret Cards"), 3 Uncommon:!fromSheet("MH1 Secret Cards"), 1 RareMythic:!fromSheet("MH1 Secret Cards"), 1 fromSheet("MH1 Lands")
|
||||||
|
BoosterBox=24
|
||||||
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ MciCode=mm2
|
|||||||
Type=Reprint
|
Type=Reprint
|
||||||
BoosterCovers=3
|
BoosterCovers=3
|
||||||
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
||||||
|
BoosterBox=24
|
||||||
FoilChanceInBooster=100
|
FoilChanceInBooster=100
|
||||||
ChaosDraftThemes=MASTERS_SET
|
ChaosDraftThemes=MASTERS_SET
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ MciCode=mm3
|
|||||||
Type=Reprint
|
Type=Reprint
|
||||||
BoosterCovers=3
|
BoosterCovers=3
|
||||||
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
||||||
|
BoosterBox=24
|
||||||
FoilChanceInBooster=100
|
FoilChanceInBooster=100
|
||||||
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ MciCode=mma
|
|||||||
Type=Reprint
|
Type=Reprint
|
||||||
BoosterCovers=3
|
BoosterCovers=3
|
||||||
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
||||||
|
BoosterBox=24
|
||||||
FoilChanceInBooster=100
|
FoilChanceInBooster=100
|
||||||
ChaosDraftThemes=MASTERS_SET
|
ChaosDraftThemes=MASTERS_SET
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=dk
|
|||||||
Type=Expansion
|
Type=Expansion
|
||||||
BoosterCovers=1
|
BoosterCovers=1
|
||||||
Booster=6 Common, 2 UncommonRare
|
Booster=6 Common, 2 UncommonRare
|
||||||
|
BoosterBox=60
|
||||||
Foil=NotSupported
|
Foil=NotSupported
|
||||||
|
|
||||||
[cards]
|
[cards]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ MciCode=uma
|
|||||||
Type=Reprint
|
Type=Reprint
|
||||||
BoosterCovers=3
|
BoosterCovers=3
|
||||||
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
Booster=11 Common, 3 Uncommon, 1 RareMythic
|
||||||
|
BoosterBox=24
|
||||||
FoilChanceInBooster=100
|
FoilChanceInBooster=100
|
||||||
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
ChaosDraftThemes=MASTERS_SET;GRAVEYARD_MATTERS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user