diff --git a/res/blockdata/boosters.txt b/res/blockdata/boosters.txt index ca12fbe229b..eb1ed0d4001 100644 --- a/res/blockdata/boosters.txt +++ b/res/blockdata/boosters.txt @@ -20,7 +20,7 @@ CFX: 3 covers, 10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand ALA CHK: 5 covers, 11 Common, 3 Uncommon, 1 Rare CHR: 1 covers, 9 Common, 3 UncommonRare CSP: 3 covers, 11 Common, 3 Uncommon, 1 Rare -DGM: 3 covers, 10 Common:!land, 3 Uncommon, 1 RareMythic:!name("Maze's End"), 1 Custom("Dragon's Maze Lands") +DGM: 3 covers, 10 Common:!land, 3 Uncommon, 1 RareMythic:!land, 1 Custom("Dragon's Maze Lands") DIS: 3 covers, 11 Common, 3 Uncommon, 1 Rare DKA: 3 covers, 9 Common:!dfc, 3 Uncommon:!dfc, 1 RareMythic:!dfc, 1 Any:dfc, 1 BasicLand ISD DRK: 1 covers, 6 Common, 2 UncommonRare diff --git a/res/blockdata/formats.txt b/res/blockdata/formats.txt index 2c05c014413..93c967bb76c 100644 --- a/res/blockdata/formats.txt +++ b/res/blockdata/formats.txt @@ -1,5 +1,16 @@ -Name:Standard|Index:1|Sets:ISD, DKA, AVR, M13, RTR, GTC, DGM -Name:Extended|Index:2|Sets:ZEN, WWK, ROE, M11, SOM, MBS, NPH, M12, ISD, DKA, AVR, M13, RTR, GTC, DGM|Banned:Stoneforge Mystic; Jace, the Mind Sculptor; Ponder; Preordain; Mental Misstep -Name:Modern|Index:3|Sets:8ED, MRD, DST, 5DN, CHK, BOK, SOK, 9ED, RAV, GPT, DIS, CSP, TSP, PLC, FUT, 10E, LRW, EVE, SHM, MOR, ALA, CFX, ARB, M10, ZEN, WWK, ROE, M11, SOM, MBS, NPH, M12, ISD, DKA, AVR, M13, RTR, GTC, DGM|Banned:Ancestral Vision; Ancient Den; Bitterblossom; Blazing Shoal; Bloodbraid Elf; Chrome Mox; Cloudpost; Dark Depths; Dread Return; Glimpse of Nature; Golgari Grave-Troll; Great Furnace; Green Sun's Zenith; Hypergenesis; Jace, the Mind Sculptor; Mental Misstep; Ponder; Preordain; Punishing Fire; Rite of Flame; Seat of the Synod; Seething Song; Sensei's Divining Top; Stoneforge Mystic; Skullclamp; Sword of the Meek; Tree of Tales; Umezawa's Jitte; Vault of Whispers; Wild Nacatl -Name:Legacy|Index:4|Banned:Amulet of Quoz; Ancestral Recall; Balance; Bazaar of Baghdad; Black Lotus; Black Vise; Bronze Tablet; Channel; Chaos Orb; Contract from Below; Darkpact; Demonic Attorney; Demonic Consultation; Demonic Tutor; Earthcraft; Falling Star; Fastbond; Flash; Frantic Search; Goblin Recruiter; Gush; Hermit Druid; Imperial Seal; Jeweled Bird; Land Tax; Library of Alexandria; Mana Crypt; Mana Drain; Mana Vault; Memory Jar; Mind Twist; Mind's Desire; Mishra's Workshop; Mox Emerald; Mox Jet; Mox Pearl; Mox Ruby; Mox Sapphire; Mystical Tutor; Necropotence; Oath of Druids; Rebirth; Shahrazad; Skullclamp; Sol Ring; Strip Mine; Survival of the Fittest; Tempest Efreet; Time Vault; Time Walk; Timetwister; Timmerian Fiends; Tinker; Tolarian Academy; Vampiric Tutor; Wheel of Fortune; Windfall; Worldgorger Dragon; Yawgmoth's Bargain; Yawgmoth's Will; Mental Misstep -Name:Vintage|Index:5|Banned:Amulet of Quoz; Bronze Tablet; Chaos Orb; Contract from Below; Darkpact; Demonic Attorney; Falling Star; Jeweled Bird; Rebirth; Shahrazad; Tempest Efreet; Timmerian Fiends \ No newline at end of file +[Standard] +Sets:ISD, DKA, AVR, M13, RTR, GTC, DGM + +[Extended] +Sets:ZEN, WWK, ROE, M11, SOM, MBS, NPH, M12, ISD, DKA, AVR, M13, RTR, GTC, DGM +Banned:Stoneforge Mystic; Jace, the Mind Sculptor; Ponder; Preordain; Mental Misstep + +[Modern] +Sets:8ED, MRD, DST, 5DN, CHK, BOK, SOK, 9ED, RAV, GPT, DIS, CSP, TSP, PLC, FUT, 10E, LRW, EVE, SHM, MOR, ALA, CFX, ARB, M10, ZEN, WWK, ROE, M11, SOM, MBS, NPH, M12, ISD, DKA, AVR, M13, RTR, GTC, DGM +Banned:Ancestral Vision; Ancient Den; Bitterblossom; Blazing Shoal; Bloodbraid Elf; Chrome Mox; Cloudpost; Dark Depths; Dread Return; Glimpse of Nature; Golgari Grave-Troll; Great Furnace; Green Sun's Zenith; Hypergenesis; Jace, the Mind Sculptor; Mental Misstep; Ponder; Preordain; Punishing Fire; Rite of Flame; Seat of the Synod; Seething Song; Sensei's Divining Top; Stoneforge Mystic; Skullclamp; Sword of the Meek; Tree of Tales; Umezawa's Jitte; Vault of Whispers; Wild Nacatl + +[Legacy] +Banned:Amulet of Quoz; Ancestral Recall; Balance; Bazaar of Baghdad; Black Lotus; Black Vise; Bronze Tablet; Channel; Chaos Orb; Contract from Below; Darkpact; Demonic Attorney; Demonic Consultation; Demonic Tutor; Earthcraft; Falling Star; Fastbond; Flash; Frantic Search; Goblin Recruiter; Gush; Hermit Druid; Imperial Seal; Jeweled Bird; Land Tax; Library of Alexandria; Mana Crypt; Mana Drain; Mana Vault; Memory Jar; Mind Twist; Mind's Desire; Mishra's Workshop; Mox Emerald; Mox Jet; Mox Pearl; Mox Ruby; Mox Sapphire; Mystical Tutor; Necropotence; Oath of Druids; Rebirth; Shahrazad; Skullclamp; Sol Ring; Strip Mine; Survival of the Fittest; Tempest Efreet; Time Vault; Time Walk; Timetwister; Timmerian Fiends; Tinker; Tolarian Academy; Vampiric Tutor; Wheel of Fortune; Windfall; Worldgorger Dragon; Yawgmoth's Bargain; Yawgmoth's Will; Mental Misstep + +[Vintage] +Banned:Amulet of Quoz; Bronze Tablet; Chaos Orb; Contract from Below; Darkpact; Demonic Attorney; Falling Star; Jeweled Bird; Rebirth; Shahrazad; Tempest Efreet; Timmerian Fiends \ No newline at end of file diff --git a/src/main/java/forge/card/FormatCollection.java b/src/main/java/forge/card/FormatCollection.java index 14444b2dc15..569ae92aaa1 100644 --- a/src/main/java/forge/card/FormatCollection.java +++ b/src/main/java/forge/card/FormatCollection.java @@ -17,13 +17,12 @@ */ package forge.card; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import forge.game.GameFormat; import forge.util.FileSection; -import forge.util.storage.StorageReaderFile; +import forge.util.storage.StorageReaderFileSections; import forge.util.storage.StorageView; /** @@ -79,46 +78,28 @@ public final class FormatCollection extends StorageView { /** * Instantiates a new format utils. */ - public static class FormatReader extends StorageReaderFile { - - /** - * TODO: Write javadoc for Constructor. - * @param file0 - * @param keySelector0 - */ + public static class FormatReader extends StorageReaderFileSections { public FormatReader(String file0) { super(file0, GameFormat.FN_GET_NAME); } - /* (non-Javadoc) - * @see forge.util.StorageReaderFile#read(java.lang.String) - */ @Override - protected GameFormat read(String line, int i) { - final List sets = new ArrayList(); // default: all sets allowed - final List bannedCards = new ArrayList(); // default: - // nothing - // banned + protected GameFormat read(String title, Iterable body, int idx) { + List sets = null; // default: all sets allowed + List bannedCards = null; // default: nothing banned - FileSection section = FileSection.parse(line, ":", "|"); - String name = section.get("name"); - int index = 1 + i; + FileSection section = FileSection.parse(body, ":"); String strSets = section.get("sets"); if ( null != strSets ) { - sets.addAll(Arrays.asList(strSets.split(", "))); + sets = Arrays.asList(strSets.split(", ")); } String strCars = section.get("banned"); if ( strCars != null ) { - bannedCards.addAll(Arrays.asList(strCars.split("; "))); + bannedCards = Arrays.asList(strCars.split("; ")); } - if (name == null) { - throw new RuntimeException("Format must have a name! Check formats.txt file"); - } - return new GameFormat(name, sets, bannedCards, index); - + return new GameFormat(title, sets, bannedCards, 1 + idx); } - } } diff --git a/src/main/java/forge/game/GameFormat.java b/src/main/java/forge/game/GameFormat.java index 0a2ed6597bf..6698a89854b 100644 --- a/src/main/java/forge/game/GameFormat.java +++ b/src/main/java/forge/game/GameFormat.java @@ -67,7 +67,7 @@ public class GameFormat implements Comparable { public GameFormat(final String fName, final Iterable sets, final List bannedCards, int compareIdx) { this.index = compareIdx; this.name = fName; - this.allowedSetCodes = Lists.newArrayList(sets); + this.allowedSetCodes = sets == null ? new ArrayList() : Lists.newArrayList(sets); this.bannedCardNames = bannedCards == null ? new ArrayList() : Lists.newArrayList(bannedCards); this.allowedSetCodes_ro = Collections.unmodifiableList(allowedSetCodes);