Moved formats into single files with new "Order", "Core" and "Name" properties.

This commit is contained in:
austinio7116
2018-03-30 21:57:13 +01:00
committed by maustin
parent 3810475ee8
commit c78d235b07
13 changed files with 88 additions and 47 deletions

View File

@@ -166,21 +166,7 @@ public final class FModel {
ForgePreferences.DEV_MODE = preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
ForgePreferences.UPLOAD_DRAFT = ForgePreferences.NET_CONN;
formats = new GameFormat.Collection(new GameFormat.Reader( new File(ForgeConstants.FORMATS_DATA_DIR + "coreformats.txt")));
final File[] files = new File(ForgeConstants.FORMATS_DATA_DIR).listFiles();
for (final File file : files) {
if (!file.getName().equals("coreformats.txt")){
GameFormat.Collection additionalformats = new GameFormat.Collection(new GameFormat.Reader(file));
for (GameFormat format:additionalformats) {
formats.add(format);
}
}
}
//still support old user custom formats if file present
GameFormat.Collection customFormats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.USER_PREFS_DIR + "customformats.txt")));
for (GameFormat format:customFormats){
formats.add(format);
}
formats = new GameFormat.Collection(new GameFormat.Reader( new File(ForgeConstants.FORMATS_DATA_DIR)));
magicDb.setStandardPredicate(formats.getStandard().getFilterRules());
magicDb.setModernPredicate(formats.getModern().getFilterRules());

View File

@@ -63,7 +63,7 @@ public final class GameFormatQuest extends GameFormat {
*/
public GameFormatQuest(final GameFormat toCopy, boolean allowSetUnlocks) {
super(toCopy.getName(), toCopy.getAllowedSetCodes(), toCopy.getBannedCardNames(), toCopy.getRestrictedCards(),
toCopy.getAllowedRarities(), toCopy.getIndex());
toCopy.getAllowedRarities(), toCopy.getIndex(), false);
allowUnlocks = allowSetUnlocks;
}