Esempio n. 1
0
        protected override void ParseExtraHandInformation(string[] handLines, Objects.Hand.HandHistorySummary handHistorySummary)
        {
            for (int i = handLines.Length - 1; i >= 0; i--)
            {
                string line = handLines[i];
                if (line.StartsWith("*** SUMMARY ***", StringComparison.Ordinal))
                {
                    return;
                }

                // Total pot $42.90 | Rake $2.10
                if (line[0] == 'T')
                {
                    int lastSpaceIndex        = line.LastIndexOf(" ", StringComparison.Ordinal);
                    int spaceAfterFirstNumber = line.IndexOf(" ", 11, StringComparison.Ordinal);

                    handHistorySummary.Rake =
                        decimal.Parse(line.Substring(lastSpaceIndex + 1, line.Length - lastSpaceIndex - 1), NumberStyles.AllowCurrencySymbol | NumberStyles.Number, NumberFormatInfo);

                    handHistorySummary.TotalPot =
                        decimal.Parse(line.Substring(10, spaceAfterFirstNumber - 10), NumberStyles.AllowCurrencySymbol | NumberStyles.Number, NumberFormatInfo);

                    return;
                }
            }

            throw new Exception("Couldn't find sumamry line.");
        }
Esempio n. 2
0
        protected override void ParseExtraHandInformation(string[] handLines, Objects.Hand.HandHistorySummary handHistorySummary)
        {
            for (int i = handLines.Length - 1; i >= 0; i--)
            {
                string handLine = handLines[i];

                // Check for summary line:
                //  *** SUMMARY ***
                if (handLine[0] == '*' && handLine[4] == 'S')
                {
                    // Line after summary line is:
                    //  Total pot $13.12 | Rake $0.59
                    // or
                    //  Total pot $62.63 Main pot $54.75. Side pot $5.38. | Rake $2.50
                    string totalLine = handLines[i + 1];

                    int lastSpaceIndex        = totalLine.LastIndexOf(" ");
                    int spaceAfterFirstNumber = totalLine.IndexOf(" ", 11);

                    handHistorySummary.Rake =
                        decimal.Parse(totalLine.Substring(lastSpaceIndex + 2, totalLine.Length - lastSpaceIndex - 2), System.Globalization.CultureInfo.InvariantCulture);

                    handHistorySummary.TotalPot =
                        decimal.Parse(totalLine.Substring(11, spaceAfterFirstNumber - 11), System.Globalization.CultureInfo.InvariantCulture);

                    break;
                }
            }
        }
Esempio n. 3
0
        protected override void ParseExtraHandInformation(string[] handLines, Objects.Hand.HandHistorySummary handHistorySummary)
        {
            for (int i = handLines.Length - 1; i >= 0; i--)
            {
                string handLine = handLines[i];
                if (handLine[0] == '*')
                {
                    return;
                }

                // Total pot $42.90 | Rake $2.10
                if (handLine[0] == 'T')
                {
                    int lastSpaceIndex        = handLine.LastIndexOf(" ", System.StringComparison.Ordinal);
                    int spaceAfterFirstNumber = handLine.IndexOf(" ", 11, System.StringComparison.Ordinal);

                    handHistorySummary.Rake =
                        decimal.Parse(handLine.Substring(lastSpaceIndex + 2, handLine.Length - lastSpaceIndex - 2), System.Globalization.CultureInfo.InvariantCulture);

                    handHistorySummary.TotalPot =
                        decimal.Parse(handLine.Substring(11, spaceAfterFirstNumber - 11), System.Globalization.CultureInfo.InvariantCulture);

                    return;
                }
            }

            throw new Exception("Couldn't find sumamry line.");
        }
Esempio n. 4
0
        protected override void ParseExtraHandInformation(string[] handLines, Objects.Hand.HandHistorySummary handHistorySummary)
        {
            //Expected Line: <SHOWDOWN NAME="HAND_SHOWDOWN" POT="3.64" RAKE="0.40">

            for (int i = handLines.Length - 1; i > 0; i--)
            {
                string line = handLines[i];
                if (line.StartsWithFast("<SHOWDOWN"))
                {
                    var TotalPot = GetXMLAttributeValue(line, "POT");
                    var Rake     = GetXMLAttributeValue(line, "RAKE");

                    handHistorySummary.Rake     = decimal.Parse(Rake, provider);
                    handHistorySummary.TotalPot = decimal.Parse(TotalPot, provider) + handHistorySummary.Rake;
                }
            }
        }
Esempio n. 5
0
        protected override void ParseExtraHandInformation(string[] handLines, Objects.Hand.HandHistorySummary handHistorySummary)
        {
            for (int i = handLines.Length - 1; i >= 0; i--)
            {
                string handLine = handLines[i];
                if (handLine[0] == '*')
                {
                    return;
                }

                // Total pot $42.90 | Rake $2.10
                if (handLine[0] == 'T')
                {
                    return;
                }
            }

            throw new Exception("Couldn't find sumamry line.");
        }