mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
updated CustomLimited to read the singleton parameter, applied it to drafts and sealed
This commit is contained in:
@@ -165,6 +165,7 @@ public final class BoosterDraft implements IBoosterDraft {
|
||||
final SealedProductTemplate tpl = draft.getSealedProductTemplate();
|
||||
|
||||
UnOpenedProduct toAdd = new UnOpenedProduct(tpl, dPool);
|
||||
toAdd.setLimitedPool(draft.isSingleton());
|
||||
for (int i = 0; i < draft.getNumPacks(); i++) {
|
||||
this.product.add(toAdd);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ public class CustomLimited extends DeckBase {
|
||||
/** The Land set code. */
|
||||
private String landSetCode = CardDb.instance().getCard("Plains", true).getEdition();
|
||||
|
||||
private boolean singleton;
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -104,6 +106,7 @@ public class CustomLimited extends DeckBase {
|
||||
final CustomLimited cd = new CustomLimited(data.get("Name"), slots);
|
||||
cd.landSetCode = data.get("LandSetCode");
|
||||
cd.numPacks = data.getInt("NumPacks");
|
||||
cd.setSingleton(data.getBoolean("Singleton"));
|
||||
final Deck deckCube = cubes.get(data.get("DeckFile"));
|
||||
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() {
|
||||
return tpl;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return singleton;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,8 @@ public class SealedDeckFormat {
|
||||
|
||||
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++) {
|
||||
this.product.add(toAdd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user