public IEnumerable <HandHistory> ParseHandHistories(string file, bool rethrowExceptions = false) { string path = Path.IsPathRooted(file) ? file : Path.Combine(SiteDetails.HandsLocation, file); HandHistoryParser.FileName = file; string text = File.ReadAllText(path); IEnumerable <string> hands = HandHistoryParser.SplitUpMultipleHands(text); HandHistoryParser.Reset(); foreach (string hand in hands) { HandHistory parsedHand = HandHistoryParser.ParseFullHandHistory(hand, rethrowExceptions); if (parsedHand != null) { yield return(parsedHand); } } }
public override TournamentSummary ParseTournamentSummary(string handHistoryFile) { TournamentSummary summary = base.ParseTournamentSummary(handHistoryFile); Match stepMatch = StepTournaments.Match(GetTournamentFile(handHistoryFile)); if (stepMatch.Success) { HandHistory lastHand = HandHistoryParser.ParseFullHandHistory( ((HandHistoryParserFast)HandHistoryParser).SplitUpMultipleHands(File.ReadAllText(handHistoryFile)).Last()); if (lastHand.Hero.StartingStack > -lastHand.HandActions.Where(a => a.PlayerName.Equals(lastHand.Hero.PlayerName)) .Sum(a => a.Amount)) { summary.Winnings = StepPrizes[int.Parse(stepMatch.Groups[0].Value) - 1]; } } return(summary); }