示例#1
0
        void handHistoryParser_PlayerFolded(string playerName, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

            // On some clients, even if the player is sitting out they will make him automatically fold
            if (p == null)
            {
                Trace.WriteLine("Fold detected but the player is not in our list... is he sitting out?");
                return;
            }

            if (gamePhase == HoldemGamePhase.Preflop)
            {
                /* Steal raise opportunity */
                if (p.IsButton && !PlayerRaisedPreflop && !PlayerLimpedPreflop && !PlayerCheckedPreflop)
                {
                    p.IncrementOpportunitiesToStealRaise();
                }

                /* Folded to a steal raise? */
                else if (p.IsSmallBlind && PlayerStealRaisedPreflop)
                {
                    p.IncrementFoldsToAStealRaise();
                }
                else if (p.IsBigBlind && PlayerStealRaisedPreflop && !SmallBlindReraisedAStealRaise)
                {
                    p.IncrementFoldsToAStealRaise();
                }


                /* Folded to a raise (but NOT to a reraise) ? */
                if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop)
                {
                    p.IncrementFoldsBlindToAPreflopRaise();
                }
            }
            // Has somebody cbet?
            else if (gamePhase == HoldemGamePhase.Flop && !PlayerRaisedTheFlop && PlayerCBet)
            {
                p.IncrementFoldToACBet();
            }

            p.HasFolded(gamePhase);
        }