Ejemplo n.º 1
0
 void RunHandHistoryParseDirectory(string handHistoryDirectory)
 {
     try
     {
         HandHistoryParser h = new HandHistoryParser(handHistoryDirectory);
         h.ParseResults();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Ejemplo n.º 2
0
 private void button7_Click(object sender, EventArgs e)
 {
     try
     {
         HandHistoryParser h = new HandHistoryParser(handDir);
         foreach (HandHistoryFile hhFile in lstHandFiles.SelectedItems)
         {
             h.ParseResultFile(hhFile.FilePath);
         }
         LoadList();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
        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);
                }
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 /* Hand history monitor handler, a new line has been read from a file */
 public void NewLineArrived(String filename, String line)
 {
     HandHistoryParser.ParseLine(line);
 }