Skip to content

Commit

Permalink
support new archidekt format
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed Aug 11, 2020
1 parent 522f6ac commit ffd0910
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 6 deletions.
4 changes: 2 additions & 2 deletions TabletopMtgImporter.Core/DeckParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public static bool TryParse(TextReader reader, out List<DeckCard> cards, out Lis
(\s+\((?<set>\w+)\)(\s(?<collectorNumber>\d+[a-zA-Z]?))?)?
# optional foil marker
(\s+\*F\*)?
# category
(\s+`(?<category>[^`]+)`)?
# category [x{a}{b}...] (new format) or `x` (old format)
(\s+[\[`](?<category>[^`\{\]]+)(\{.*?\})*[\]`])?
# label
(\s+\^(?<label>[^\^]+)\^)?\s*
$",
Expand Down
6 changes: 4 additions & 2 deletions TabletopMtgImporter.Tests/EndToEndTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ namespace TabletopMtgImporter.Tests
{
public class EndToEndTest
{
[TestCase("Archidekt1CardNameFormat.txt", ExpectedResult = "count=107,hash=7PEsdf5KnAN+LLwFv5dn1g==")]
[TestCase("Archidekt1xCardNameCodeCategoryLabel.txt", ExpectedResult = "count=104,hash=0ouYK2tXro2mNv0xkoB6Cg==")]
[TestCase("Archidekt1CardNameFormat.txt", ExpectedResult = "count=108,hash=1Tn1wG0GoooaY2MmHwvB2g==")]
[TestCase("Archidekt1xCardNameCodeCategoryLabel.txt", ExpectedResult = "count=105,hash=6dg6IPECMxAOVUuKFcR8yQ==")]
[TestCase("MaybeboardAndAlternateArtCollectorNumber.txt", ExpectedResult = "count=108,hash=zHg9fZWqNKk6wlJmoLBu0w==")]
[TestCase("ComboPieceRelatedCards.txt", ExpectedResult = "count=115,hash=hthbJgpnr1Ul4CI3x8cB7A==")]
[TestCase("Foils.txt", ExpectedResult = "count=107,hash=6ihzVsB60rC39ZlEJSTIsA==")]
[TestCase("SameNameTokens.txt", ExpectedResult = "count=115,hash=hthbJgpnr1Ul4CI3x8cB7A==")]
[TestCase("ArchidektUpdatedCategoryFormat.txt", ExpectedResult = "count=101,hash=B+6eJzK8ihFObkI/htreeg==")]
[TestCase("ArchidektUpdatedCategoryFormatMultipleCommanders.txt", ExpectedResult = "count=103,hash=jzAhbtVejcFgDWWJOzKFHw==")]
public async Task<string> TestRunsEndToEndWithoutErrors(string sampleName)
{
using var sample = SamplesHelper.GetSample(sampleName);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
1x Phyrexian Scriptures (dom) [Synergy]
1x Sulfur Falls (dom)
1x Mer-Ek Nightblade (ima) [Synergy]
1x Herald of Secret Streams (xln) [Synergy]
1x Dragonskull Summit (xln)
1x Drowned Catacomb (xln)
1x Patron of the Vein (c17) [Always Counters]
1x Marchesa, the Black Rose (c17) [Commander{top}]
1x Talisman of Dominance (e01) [Ramp]
1x Talisman of Indulgence (e01) [Ramp]
1x Scalding Tarn (mm3)
1x Yahenni, Undying Partisan (aer) [Sac Outlet]
1x Animation Module (kld) [Synergy]
1x Vandalblast (c15) [Utility]
1x Smothering Abomination (bfz) [Synergy]
1x Vampiric Rites (bfz) [Sac Outlet]
1x Novijen Sages (mm2) [Always Counters]
1x Bloodstained Mire (ktk)
1x Polluted Delta (ktk)
1x Feast on the Fallen (m15) [Give Counters]
1x Geralf's Mindcrusher (dka) [Always Counters]
1x Undying Evil (dka) [Give Counters]
1x Pyreheart Wolf (dka) [Always Counters]
1x Grimgrin, Corpse-Born (isd) [Sac Outlet]
1x Tar Fiend (ala) [Sac Outlet]
1x Caldera Hellion (ala) [Sac Outlet]
1x Stingmoggie (mor) [Always Counters]
1x Cytoplast Manipulator (dis) [Always Counters]
1x Unspeakable Symbol (scg) [Give Counters]
1x Entrails Feaster (ons) [Sometimes Counters]
1x Mindwarper (sth) [Always Counters]
1x Spitting Hydra (sth) [Always Counters]
1x Magmasaur (tmp) [Always Counters]
4x Island (mir) 338
6x Swamp (mir) 342
5x Mountain (mir) 344
1x Wayfarer's Bauble (cm2) [Ramp]
1x Fellwar Stone (cm2) [Ramp]
1x Bloodtracker (c18) [Synergy]
1x Watery Grave (grn)
1x Steam Vents (grn)
1x Dimir Signet (gk1) [Ramp]
1x Bloodflow Connoisseur (uma) [Sac Outlet]
1x Blood Crypt (rna)
1x Skarrgan Hellkite (rna) [Always Counters]
1x Skatewing Spy (rna) [Synergy]
1x Clamor Shaman (rna) [Always Counters]
1x Teferi's Time Twist (war) [Give Counters]
1x Spark Double (war) [Always Counters]
1x Talisman of Creativity (mh1) [Ramp]
1x Embodiment of Agonies (m20) [Always Counters]
1x Scroll of Fate (c19) [Synergy]
1x Thought Sponge (c19) [Always Counters]
1x Grim Haruspex (c19) [Synergy]
1x Flayer of the Hatebound (c19) [Always Counters]
1x Crumbling Necropolis (mb1)
1x Burnished Hart (mb1) [Ramp]
1x Ashnod's Altar (mb1) [Sac Outlet]
1x Preyseizer Dragon (mb1) [Sac Outlet]
1x Mark of Mutiny (mb1) [Synergy]
1x Goblin Bombardment (mb1) [Sac Outlet]
1x Living Death (mb1) [Synergy]
1x Dictate of Erebos (mb1) [Synergy]
1x Carrion Feeder (mb1) [Sac Outlet]
1x Vigean Graftmage (mb1) [Always Counters]
1x Arcane Signet (c20) [Ramp]
1x Agitator Ant (c20) [Give Counters]
1x Command Tower (c20)
1x Sol Ring (c20) [Ramp]
1x The Ozolith (iko) [Synergy]
1x Rakdos Carnarium (c20)
1x Izzet Boilerworks (c20)
1x Exotic Orchard (c20)
1x Dimir Aqueduct (c20)
1x Bojuka Bog (c20)
1x Skullclamp (c20) [Synergy]
1x Rakdos Signet (c20) [Ramp]
1x Izzet Signet (c20) [Ramp]
1x Chaos Warp (c20) [Utility]
1x Solemn Simulacrum (m21) [Ramp]
1x Phyrexian Tower (jmp)
1x Unstable Obelisk (jmp) [Ramp]
1x Oona's Blackguard (jmp) [Synergy]
1x Blasphemous Act (2xm) [Synergy]
1x Sunken Ruins (2xm)
1x Graven Cairns (2xm)
1x High Market (2xm)
1x Cascade Bluffs (2xm)
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
1x Firefist Adept (dom) [Value Wizards]
1x Naban, Dean of Iteration (dom) [Synergy]
1x Sulfur Falls (dom)
1x Whisper, Blood Liturgist (dom) [Sac Outlets]
1x Shadowmage Infiltrator (a25) [Draw]
1x River of Tears (ima)
1x Dragonskull Summit (xln)
1x Drowned Catacomb (xln)
1x Curse of Verbosity (c17) [Draw]
1x Bloodline Necromancer (c17) [Value Wizards]
1x Vindictive Lich (c17) [Value Wizards]
1x Inalla, Archmage Ritualist (c17) *F* [Commander{top}]
1x Necromantic Selection (c17) [Utility]
1x Puppeteer Clique (c17) [Temp Creatures]
1x Havengul Lich (c17) [Value Wizards]
1x Talisman of Dominance (e01) [Ramp]
1x Talisman of Indulgence (e01) [Ramp]
1x Venser, Shaper Savant (mm3) [Value Wizards]
1x Flameshadow Conjuring (ori) [Temp Creatures]
1x Flesh Carver (c14) [Sac Outlets]
1x Galvanic Juggernaut (cns) [Untap]
1x Viscera Seer (c13) [Sac Outlets]
1x Beguiler of Wills (dka) [Value Wizards]
1x Attrition (cmd) [Sac Outlets]
1x Anathemancer (arb) [Value Wizards]
1x Fatestitcher (ala) [Untap]
1x Stonybrook Banneret (mor) [Ramp]
1x Rakdos Riteknife (dis) [Commander{top}]
1x Spawnbroker (rav) [Value Wizards]
1x Faces of the Past (scg) [Untap]
1x Aphetto Alchemist (ons) [Untap]
1x Goblin Sharpshooter (ons) [Untap]
1x Stern Proctor (usg) [Value Wizards]
1x Coffin Queen (tmp) [Temp Creatures]
7x Island (mir) 338
7x Swamp (mir) 342
6x Mountain (mir) 344
1x Grip of Phyresis (cm2) [Utility]
1x Sower of Temptation (bbd) [Temp Creatures]
1x Watery Grave (grn)
1x Steam Vents (grn)
1x Dimir Signet (gk1) [Ramp]
1x Apprentice Necromancer (uma) [Temp Creatures]
1x Blood Crypt (rna)
1x Talisman of Creativity (mh1) [Ramp]
1x Watcher for Tomorrow (mh1) [Draw]
1x Graveshifter (mh1) [Value Wizards]
1x Grim Haruspex (c19) [Draw]
1x Crumbling Necropolis (mb1)
1x Crosis's Charm (mb1) [Utility]
1x Purphoros, God of the Forge (mb1) [Synergy]
1x Impact Tremors (mb1) [Synergy]
1x Curse of Opulence (mb1) [Ramp]
1x Youthful Scholar (mb1) [Draw]
1x Cloudkin Seer (mb1) [Draw]
1x The Akroan War (thb) [Temp Creatures]
1x Thassa, Deep-Dwelling (thb) [Synergy]
1x Soul-Guide Lantern (thb) [Utility]
1x Arcane Signet (c20) [Ramp]
1x Molten Echoes (c20) [Temp Creatures]
1x Path of Ancestry (c20)
1x Titan Hunter (c20) [Sac Outlets]
1x Command Tower (c20)
1x Sol Ring (c20) [Ramp]
1x Rakdos Carnarium (c20)
1x Izzet Boilerworks (c20)
1x Exotic Orchard (c20)
1x Dimir Aqueduct (c20)
1x Bojuka Bog (c20)
1x Skullclamp (c20) [Draw]
1x Swiftfoot Boots (c20) [Synergy]
1x Rakdos Signet (c20) [Ramp]
1x Izzet Signet (c20) [Ramp]
1x Lightning Greaves (c20) [Synergy]
1x Xathrid Necromancer (c20) [Value Wizards]
1x Disciple of Bolas (c20) [Draw]
1x Portal Mage (c20) [Value Wizards]
1x Fabled Passage (m21)
1x Thriving Moor (jmp)
1x Kels, Fight Fixer (jmp) [Sac Outlets]
1x Sea Gate Oracle (jmp) [Draw]
1x Riptide Laboratory (jmp)
1x Dualcaster Mage (jmp) [Value Wizards]
1x Wayfarer's Bauble (cm2) [Maybeboard{noDeck}{noPrice}]
1x Dictate of Erebos (mb1) [Maybeboard{noDeck}{noPrice}]
1x Master of Waves (ths) [Maybeboard{noDeck}{noPrice}]
1x Mirror March (rna) [Maybeboard{noDeck}{noPrice}]
1x Thoughtpicker Witch (rav) [Maybeboard{noDeck}{noPrice}]
1x Tribute Mage (mh1) [Maybeboard{noDeck}{noPrice}]
1x Keeper of the Dead (exo) [Maybeboard{noDeck}{noPrice}]
1x Silumgar Sorcerer (dtk) [Maybeboard{noDeck}{noPrice}]
1x Jeleva, Nephalia's Scourge (c13) [Maybeboard{noDeck}{noPrice}]
4 changes: 2 additions & 2 deletions TabletopMtgImporter.Wpf/TabletopMtgImporter.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<AssemblyName>TabletopMTGImporterGUI</AssemblyName>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<FileVersion>0.2.0.0</FileVersion>
<AssemblyVersion>0.3.0.0</AssemblyVersion>
<FileVersion>0.3.0.0</FileVersion>
<TargetFramework>net461</TargetFramework>
<UseWPF>true</UseWPF>
<LangVersion>8.0</LangVersion>
Expand Down

0 comments on commit ffd0910

Please sign in to comment.