mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
fix bugs in minimal set calculation.
added that column to itemmanager
This commit is contained in:
@@ -11,6 +11,7 @@ import com.google.common.base.Predicate;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.StaticData;
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.ColorSet;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
@@ -48,7 +49,7 @@ public class DeckProxy implements InventoryItem {
|
||||
private int sbSize = Integer.MIN_VALUE;
|
||||
private final String path;
|
||||
private final Function<IHasName, Deck> fnGetDeck;
|
||||
private String edition;
|
||||
private CardEdition edition;
|
||||
|
||||
public DeckProxy(Deck deck, GameType type, IStorage<? extends IHasName> storage) {
|
||||
this(deck, type, "", storage, null);
|
||||
@@ -85,12 +86,12 @@ public class DeckProxy implements InventoryItem {
|
||||
return path;
|
||||
}
|
||||
|
||||
public String getEdition() {
|
||||
public CardEdition getEdition() {
|
||||
if ( null == edition ) {
|
||||
if ( deck instanceof PreconDeck )
|
||||
edition = ((PreconDeck) deck).getEdition();
|
||||
edition = StaticData.instance().getEditions().get(((PreconDeck) deck).getEdition());
|
||||
if ( !isGeneratedDeck() )
|
||||
edition = StaticData.instance().getEditions().getEarliestEditionWithAllCards(getDeck().getAllCardsInASinglePool()).getCode();
|
||||
edition = StaticData.instance().getEditions().getEarliestEditionWithAllCards(getDeck().getAllCardsInASinglePool());
|
||||
}
|
||||
return edition;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ public final class DeckManager extends ItemManager<DeckProxy> {
|
||||
ColumnDef.NAME,
|
||||
ColumnDef.DECK_COLOR,
|
||||
ColumnDef.DECK_FORMAT,
|
||||
ColumnDef.DECK_EDITION,
|
||||
ColumnDef.DECK_MAIN,
|
||||
ColumnDef.DECK_SIDE);
|
||||
|
||||
|
||||
@@ -337,6 +337,19 @@ public enum ColumnDef {
|
||||
return StringUtils.join(Iterables.transform(deck.getFormats(), GameFormat.FN_GET_NAME) , ", ");
|
||||
}
|
||||
}),
|
||||
DECK_EDITION("Min.Set", "Min.Set", 30, 30, 30, SortState.ASC, new ItemCellRenderer(),
|
||||
new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
||||
@Override
|
||||
public Comparable<?> apply(final Entry<InventoryItem, Integer> from) {
|
||||
return toDeck(from.getKey()).getEdition();
|
||||
}
|
||||
},
|
||||
new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
||||
@Override
|
||||
public Object apply(final Entry<? extends InventoryItem, Integer> from) {
|
||||
return toDeck(from.getKey()).getEdition().getCode();
|
||||
}
|
||||
}),
|
||||
DECK_MAIN("Main", "Main Deck", 30, 30, 30, SortState.ASC, new IntegerRenderer(),
|
||||
new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user