mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
fixed type for boosterpack, base price set to $3.95, fixed text, removed unused imports
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package forge.card;
|
||||
|
||||
import forge.Constant;
|
||||
import forge.FileUtil;
|
||||
import forge.MyRandom;
|
||||
import forge.deck.Deck;
|
||||
import forge.item.CardDb;
|
||||
@@ -9,7 +7,6 @@ import forge.item.CardPrinted;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@@ -255,6 +255,8 @@ public final class DeckEditorShop extends DeckEditorBase {
|
||||
case MythicRare: return Integer.valueOf(600);
|
||||
default: return Integer.valueOf(15);
|
||||
}
|
||||
} else if (card instanceof BoosterPack) {
|
||||
return 395;
|
||||
}
|
||||
return 1337;
|
||||
}
|
||||
@@ -278,7 +280,7 @@ public final class DeckEditorShop extends DeckEditorBase {
|
||||
|
||||
List<CardPrinted> newCards = booster.getCards();
|
||||
for (CardPrinted card : newCards) { bottom.addCard(card); }
|
||||
CardListViewer c = new CardListViewer(booster.getName(), "You have found the following new cards inside booster", newCards);
|
||||
CardListViewer c = new CardListViewer(booster.getName(), "You have found the following cards inside:", newCards);
|
||||
c.show();
|
||||
|
||||
questData.getCards().buyBooster(booster, value);
|
||||
|
||||
@@ -20,7 +20,6 @@ public abstract class PresetColumns {
|
||||
|
||||
private static CardManaCost toManaCost(InventoryItem i) { return i instanceof CardPrinted ? ((CardPrinted) i).getCard().getManaCost() : CardManaCost.empty; }
|
||||
private static CardColor toColor(InventoryItem i) { return i instanceof CardPrinted ? ((CardPrinted) i).getCard().getColor() : CardColor.nullColor; }
|
||||
private static String toType(InventoryItem i) { return i instanceof CardPrinted ? ((CardPrinted) i).getCard().getType().toString() : i.getClass().toString(); }
|
||||
private static String toPTL(InventoryItem i) { return i instanceof CardPrinted ? ((CardPrinted) i).getCard().getPTorLoyalty() : ""; }
|
||||
private static CardRarity toRarity(InventoryItem i) { return i instanceof CardPrinted ? ((CardPrinted) i).getRarity() : CardRarity.Unknown; }
|
||||
private static CardSet toSetCmp(InventoryItem i) { return i instanceof InventoryItemFromSet ? SetUtils.getSetByCode(((InventoryItemFromSet) i).getSet()) : CardSet.unknown; }
|
||||
@@ -63,10 +62,10 @@ public abstract class PresetColumns {
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static final Lambda1<Comparable, Entry<InventoryItem, Integer>> fnTypeCompare =
|
||||
new Lambda1<Comparable, Entry<InventoryItem, Integer>>() { @Override
|
||||
public Comparable apply(final Entry<InventoryItem, Integer> from) { return toType(from.getKey()); } };
|
||||
public Comparable apply(final Entry<InventoryItem, Integer> from) { return from.getKey().getType(); } };
|
||||
public static final Lambda1<Object, Entry<InventoryItem, Integer>> fnTypeGet =
|
||||
new Lambda1<Object, Entry<InventoryItem, Integer>>() { @Override
|
||||
public Object apply(final Entry<InventoryItem, Integer> from) { return toType(from.getKey()); } };
|
||||
public Object apply(final Entry<InventoryItem, Integer> from) { return from.getKey().getType(); } };
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static final Lambda1<Comparable, Entry<InventoryItem, Integer>> fnStatsCompare =
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import forge.SetUtils;
|
||||
import forge.card.BoosterGenerator;
|
||||
import forge.card.CardSet;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
@@ -11,17 +12,22 @@ import forge.card.BoosterGenerator;
|
||||
*/
|
||||
public class BoosterPack implements InventoryItemFromSet {
|
||||
|
||||
private final String cardSet;
|
||||
private final CardSet cardSet;
|
||||
private final String name;
|
||||
|
||||
private List<CardPrinted> cards = null;
|
||||
|
||||
public BoosterPack(String set) {
|
||||
cardSet = set;
|
||||
name = SetUtils.getSetByCodeOrThrow(set).getName() + " booster";
|
||||
this(SetUtils.getSetByCodeOrThrow(set));
|
||||
}
|
||||
|
||||
@Override public String getSet() { return cardSet; }
|
||||
public BoosterPack(CardSet set) {
|
||||
cardSet = set;
|
||||
name = cardSet.getName() + " Booster Pack";
|
||||
}
|
||||
|
||||
|
||||
@Override public String getSet() { return cardSet.getCode(); }
|
||||
@Override public String getName() { return name; }
|
||||
|
||||
@Override public String getImageFilename() {
|
||||
@@ -32,7 +38,7 @@ public class BoosterPack implements InventoryItemFromSet {
|
||||
public List<CardPrinted> getCards() {
|
||||
if (null == cards)
|
||||
{
|
||||
BoosterGenerator gen = new BoosterGenerator(SetUtils.getSetByCode(cardSet));
|
||||
BoosterGenerator gen = new BoosterGenerator(cardSet);
|
||||
cards = gen.getBoosterPack();
|
||||
// TODO: Add land here!
|
||||
}
|
||||
@@ -64,6 +70,14 @@ public class BoosterPack implements InventoryItemFromSet {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.item.InventoryItem#getType()
|
||||
*/
|
||||
@Override
|
||||
public String getType() {
|
||||
return "Booster Pack";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public final class CardPrinted implements Comparable<CardPrinted>, InventoryItem
|
||||
if (imageFilename == null) { imageFilename = CardUtil.buildFilename(this); }
|
||||
return imageFilename;
|
||||
}
|
||||
public String getType() { return card.getType().toString(); }
|
||||
|
||||
// Lambda to get rules for selects from list of printed cards
|
||||
public static final Lambda1<CardRules, CardPrinted> fnGetRules = new Lambda1<CardRules, CardPrinted>() {
|
||||
|
||||
@@ -9,4 +9,6 @@ public interface InventoryItem /* extends Comparable */ {
|
||||
String getName();
|
||||
/** An inventory item has to provide a picture. */
|
||||
String getImageFilename();
|
||||
/** Return type as a string */
|
||||
String getType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user