Esempio n. 1
0
 // TODO:
 private void ProcessTimedOutLine(TimedOutLine timedOutLine)
 {
 }
Esempio n. 2
0
        public void ProcessLine(string line)
        {
            ILine l = null;

            try
            {
                if (line.StartsWith("PokerStars"))
                {
                    StartNewHand();
                    l = ProcessInitializationLine(line);
                }
                else if (line.StartsWith("***"))
                {
                    l = ProcessRoundLine(line);
                }
                else if (line.Contains("said, ") || line.Contains("joins the table") || line.Contains("leaves the table") || line.Contains(" is connected "))
                {
                    l = new CommentLine(line);
                }
                else if (line.Contains("collected") && (line.Contains("from pot") || line.Contains("from side pot") || line.Contains("from main pot")))
                {
                    l = ProcessGameActionLine(line);
                }
                else if (line.Contains("finished the tournament"))
                {
                    l = ProcessGameActionLine(line);
                }
                else if (line.Contains("wins the tournament"))
                {
                    l = new CommentLine(line);
                }
                else if (line.Contains("has timed out"))
                {
                    l = new TimedOutLine(line);
                }
                else
                {
                    switch (current.Round)
                    {
                    case HandRound.Initialization:
                    {
                        l = ProcessInitializationLine(line);
                        break;
                    }

                    case HandRound.HoleCards:
                    {
                        l = ProcessHoleCardsLine(line);
                        break;
                    }

                    case HandRound.Flop:
                    {
                        l = ProcessFlopLine(line);
                        break;
                    }

                    case HandRound.Turn:
                    {
                        l = ProcessTurnLine(line);
                        break;
                    }

                    case HandRound.River:
                    {
                        l = ProcessRiverLine(line);
                        break;
                    }

                    case HandRound.Showdown:
                    {
                        l = ProcessShowdownLine(line);
                        break;
                    }

                    case HandRound.Summary:
                    {
                        l = ProcessSummaryLine(line);
                        break;
                    }

                    default:
                    {
                        ErrorMessage("Unrecognized Hand Round " + current.Round.ToString());
                        break;
                    }
                    }
                }

                if (l != null)
                {
                    ProcessLineData(l);
                }
                else
                {
                    if (!String.IsNullOrEmpty(line))
                    {
                        UnparsedLine(lineIdx + ": " + "Unparsed Line in ProcessGameActionLine: " + line);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorMessage(lineIdx + ": " + line + "   " + ex.ToString());
            }
        }