public void DumpNotes_ForConjurerMage() { var eventStore = new HsEventStore.HsEventStore(); var events = (List <HsGamePlayedEvent>) eventStore.Get <HsGamePlayedEvent>("game-played"); sut.DumpNotes( homeDeck: "Lackey Rogue", oppDeck: "Conjurer Mage", results: events); }
public void DumpNotes_ForTheMirror_DoesNotDoubleCount() { var eventStore = new HsEventStore.HsEventStore(); var events = (List <HsGamePlayedEvent>) eventStore.Get <HsGamePlayedEvent>("game-played"); sut.DumpNotes( homeDeck: "Control Priest", oppDeck: "Control Priest", results: events); }
private static void Validate( HsEventStore.HsEventStore eventStore, DeckDetector dd) { var results = (List <HsGamePlayedEvent>) eventStore.Get <HsGamePlayedEvent>("game-played"); foreach (var game in results) { if (!dd.IsValidDeckname(game.HomeDeck)) { Console.WriteLine($"Unknown deck {game.HomeDeck}"); } if (!dd.IsValidDeckname(game.OpponentDeck)) { Console.WriteLine($"Unknown deck {game.OpponentDeck}"); } } }
private static void Main(string[] args) { var dd = new DeckDetector(); var homeDeck = Environment.GetEnvironmentVariable("HOMEDECK"); #if DEBUG homeDeck = "Libram Paladin"; Console.WriteLine($"Home Deck is {homeDeck}"); #endif var eventStore = new HsEventStore.HsEventStore(); #if DEBUG Validate(eventStore, dd); #endif var oppDeck = string.Empty; var options = new Options(); IEnumerable <string> cardsPlayed = new List <string>(); var result = Parser.Default.ParseArguments <Options>(args) .WithParsed(o => options.Report = o.Report) .WithParsed(o => options.ReportDate = o.ReportDate) .WithParsed(o => options.HeroClass = o.HeroClass) .WithParsed(o => options.Opponent = o.Opponent) .WithParsed(o => options.Mulligan = o.Mulligan) .WithParsed(o => options.Quota = o.Quota) .WithParsed(o => options.AllDecks = o.AllDecks) .WithParsed(o => cardsPlayed = o.Played); if (options.Report != null) { // -r dd.Report( report: options.Report, eventStore: eventStore, homeDeck: homeDeck, dd: dd, reportDate: options.ReportDate, heroClass: options.HeroClass, quota: GetQuota(options.Quota), allDecks: options.AllDecks); #if DEBUG Console.ReadLine(); #endif return; } var results = (List <HsGamePlayedEvent>) eventStore.Get <HsGamePlayedEvent>("game-played"); if (string.IsNullOrEmpty(options.Opponent)) { var decks = dd.ListDecks( heroClass: options.HeroClass, played: cardsPlayed.ToArray()); if (decks.Count == 0) { Console.WriteLine("Off-Meta Deck"); } else { oppDeck = DumpDecks( decks, homeDeck, dd, results); } } else { oppDeck = options.Opponent; var displayDeck = dd.FindDeck(oppDeck); if (displayDeck.IsEmpty()) { Console.WriteLine($"{oppDeck} not found"); return; } displayDeck.Dump(); } //if (cardsPlayed.Any()) //{ dd.DumpMetaRecord( results); dd.DumpPreviousMonthRecord( results); dd.DumpMonthRecord( results); dd.DumpDeckRecord( homeDeck, results); dd.DumpDeckMonthRecord( homeDeck, results); dd.DumpRunRecord( results); dd.DumpDailyRecord( results); Console.WriteLine( value: K_DividerLine); dd.DumpDeckRecordVsHero( homeDeck, results, options.HeroClass); //} dd.DumpNotes( homeDeck, oppDeck, results); Console.WriteLine( value: K_DividerLine); dd.DumpTips( homeDeck, oppDeck); if (!cardsPlayed.Any()) { if (!string.IsNullOrEmpty(options.Mulligan)) { dd.DumpMulligans( homeDeck, oppDeck, options.Mulligan); } } Console.WriteLine(); #if DEBUG Console.ReadLine(); #endif }