mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Fix defaults booster box counts for certain edition types
This commit is contained in:
@@ -65,7 +65,17 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
FROM_THE_VAULT,
|
||||
|
||||
OTHER,
|
||||
THIRDPARTY // custom sets
|
||||
THIRDPARTY; // custom sets
|
||||
|
||||
public String getBoosterBoxDefault() {
|
||||
switch (this) {
|
||||
case CORE:
|
||||
case EXPANSION:
|
||||
return "36";
|
||||
default:
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum FoilType {
|
||||
@@ -457,7 +467,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
}
|
||||
res.type = enumType;
|
||||
res.prerelease = section.get("Prerelease", null);
|
||||
res.boosterBoxCount = Integer.parseInt(section.get("BoosterBox", "36"));
|
||||
res.boosterBoxCount = Integer.parseInt(section.get("BoosterBox", enumType.getBoosterBoxDefault()));
|
||||
|
||||
switch(section.get("foil", "newstyle").toLowerCase()) {
|
||||
case "notsupported":
|
||||
|
||||
@@ -57,7 +57,9 @@ public abstract class SealedProduct implements InventoryItemFromSet {
|
||||
|
||||
public SealedProduct(String name0, Template boosterData) {
|
||||
if (null == name0) { throw new IllegalArgumentException("name0 must not be null"); }
|
||||
if (null == boosterData) { throw new IllegalArgumentException("boosterData must not be null"); }
|
||||
if (null == boosterData) {
|
||||
throw new IllegalArgumentException("boosterData must not be null");
|
||||
}
|
||||
contents = boosterData;
|
||||
name = name0;
|
||||
hash = name.hashCode() ^ getClass().hashCode() ^ contents.hashCode();
|
||||
|
||||
Reference in New Issue
Block a user