updated CustomLimited to read the singleton parameter, applied it to drafts and sealed

This commit is contained in:
Maxmtg
2013-04-27 18:15:01 +00:00
parent 59aea5375a
commit 7858460391
4 changed files with 12 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
Name:SkieraCube Name:SkieraCube
DeckFile:SkieraCube DeckFile:SkieraCube
Singleton:True
LandSetCode:M11 LandSetCode:M11
Booster: 5 Common, 5 Uncommon, 5 Rare, 1 Mythic Booster: 16 Any
NumPacks:3 NumPacks:3

View File

@@ -165,6 +165,7 @@ public final class BoosterDraft implements IBoosterDraft {
final SealedProductTemplate tpl = draft.getSealedProductTemplate(); final SealedProductTemplate tpl = draft.getSealedProductTemplate();
UnOpenedProduct toAdd = new UnOpenedProduct(tpl, dPool); UnOpenedProduct toAdd = new UnOpenedProduct(tpl, dPool);
toAdd.setLimitedPool(draft.isSingleton());
for (int i = 0; i < draft.getNumPacks(); i++) { for (int i = 0; i < draft.getNumPacks(); i++) {
this.product.add(toAdd); this.product.add(toAdd);
} }

View File

@@ -68,6 +68,8 @@ public class CustomLimited extends DeckBase {
/** The Land set code. */ /** The Land set code. */
private String landSetCode = CardDb.instance().getCard("Plains", true).getEdition(); private String landSetCode = CardDb.instance().getCard("Plains", true).getEdition();
private boolean singleton;
/* /*
* (non-Javadoc) * (non-Javadoc)
@@ -104,6 +106,7 @@ public class CustomLimited extends DeckBase {
final CustomLimited cd = new CustomLimited(data.get("Name"), slots); final CustomLimited cd = new CustomLimited(data.get("Name"), slots);
cd.landSetCode = data.get("LandSetCode"); cd.landSetCode = data.get("LandSetCode");
cd.numPacks = data.getInt("NumPacks"); cd.numPacks = data.getInt("NumPacks");
cd.setSingleton(data.getBoolean("Singleton"));
final Deck deckCube = cubes.get(data.get("DeckFile")); final Deck deckCube = cubes.get(data.get("DeckFile"));
cd.cardPool = deckCube == null ? ItemPool.createFrom(CardDb.instance().getUniqueCards(), CardPrinted.class) : deckCube.getMain(); cd.cardPool = deckCube == null ? ItemPool.createFrom(CardDb.instance().getUniqueCards(), CardPrinted.class) : deckCube.getMain();
@@ -166,4 +169,8 @@ public class CustomLimited extends DeckBase {
public SealedProductTemplate getSealedProductTemplate() { public SealedProductTemplate getSealedProductTemplate() {
return tpl; return tpl;
} }
public boolean isSingleton() {
return singleton;
}
} }

View File

@@ -268,7 +268,8 @@ public class SealedDeckFormat {
Integer nrBoosters = GuiChoose.one("How many booster packs?", integers); Integer nrBoosters = GuiChoose.one("How many booster packs?", integers);
IUnOpenedProduct toAdd = new UnOpenedProduct(draft.getSealedProductTemplate(), draft.getCardPool()); UnOpenedProduct toAdd = new UnOpenedProduct(draft.getSealedProductTemplate(), draft.getCardPool());
toAdd.setLimitedPool(draft.isSingleton());
for (int i = 0; i < nrBoosters; i++) { for (int i = 0; i < nrBoosters; i++) {
this.product.add(toAdd); this.product.add(toAdd);
} }