Fix up some stuff around deck editing & loading for tiny leaders format.

This commit is contained in:
Myrd
2015-12-26 06:10:51 +00:00
parent 5a762aa823
commit 3d1d6cff2a
9 changed files with 60 additions and 94 deletions

View File

@@ -366,7 +366,7 @@ public class DeckProxy implements InventoryItem {
else {
filter = Predicates.and(DeckFormat.TinyLeaders.hasLegalCardsPredicate(), filter);
}
addDecksRecursivelly("Tiny Leaders", GameType.TinyLeaders, result, "", FModel.getDecks().getCommander(), filter);
addDecksRecursivelly("Tiny Leaders", GameType.TinyLeaders, result, "", FModel.getDecks().getTinyLeaders(), filter);
return result;
}

View File

@@ -42,6 +42,7 @@ public class CardCollections {
private final IStorage<Deck> scheme;
private final IStorage<Deck> plane;
private final IStorage<Deck> commander;
private final IStorage<Deck> tinyLeaders;
public CardCollections() {
final StopWatch sw = new StopWatch();
@@ -54,6 +55,7 @@ public class CardCollections {
scheme = new StorageImmediatelySerialized<Deck> ("Archenemy decks", new DeckStorage(new File(ForgeConstants.DECK_SCHEME_DIR), ForgeConstants.DECK_BASE_DIR));
plane = new StorageImmediatelySerialized<Deck> ("Planechase decks", new DeckStorage(new File(ForgeConstants.DECK_PLANE_DIR), ForgeConstants.DECK_BASE_DIR));
commander = new StorageImmediatelySerialized<Deck> ("Commander decks", new DeckStorage(new File(ForgeConstants.DECK_COMMANDER_DIR), ForgeConstants.DECK_BASE_DIR));
tinyLeaders = new StorageImmediatelySerialized<Deck> ("Tiny Leaders decks", new DeckStorage(new File(ForgeConstants.DECK_TINY_LEADERS_DIR), ForgeConstants.DECK_BASE_DIR));
sw.stop();
System.out.printf("Read decks (%d ms): %d constructed, %d sealed, %d draft, %d cubes, %d scheme, %d planar, %d commander.%n", sw.getTime(), constructed.size(), sealed.size(), draft.size(), cube.size(), scheme.size(), plane.size(), commander.size());
}
@@ -89,4 +91,8 @@ public class CardCollections {
public IStorage<Deck> getCommander() {
return commander;
}
public IStorage<Deck> getTinyLeaders() {
return tinyLeaders;
}
}

View File

@@ -122,6 +122,7 @@ public final class ForgeConstants {
public static final String DECK_NET_DIR = DECK_BASE_DIR + "net" + PATH_SEPARATOR;
public static final String QUEST_SAVE_DIR = USER_QUEST_DIR + "saves" + PATH_SEPARATOR;
public static final String CONQUEST_SAVE_DIR = USER_CONQUEST_DIR + "saves" + PATH_SEPARATOR;
public static final String DECK_TINY_LEADERS_DIR= DECK_BASE_DIR + "tiny_leaders" + PATH_SEPARATOR;
public static final String MAIN_PREFS_FILE = USER_PREFS_DIR + "forge.preferences";
public static final String CARD_PREFS_FILE = USER_PREFS_DIR + "card.preferences";
public static final String DECK_PREFS_FILE = USER_PREFS_DIR + "deck.preferences";