예제 #1
0
        void handHistoryParser_PlayerRaised(string playerName, float raiseAmount, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

            if (p == null)
            {
                Trace.WriteLine("Raise detected but the player is not in our list. Did he just join?");
                return;
            }


            if (gamePhase == HoldemGamePhase.Preflop)
            {
                /* If somebody already raised, this is a reraise */
                if (PlayerRaisedPreflop)
                {
                    PlayerReRaisedPreflop = true;
                }

                /* If this player is the button and he raises while nobody raised or limped before him
                 * this is a good candidate for a steal raise */
                if (p.IsButton && !PlayerRaisedPreflop && !PlayerLimpedPreflop && !PlayerCheckedPreflop)
                {
                    p.IncrementOpportunitiesToStealRaise();
                    p.IncrementStealRaises();

                    PlayerStealRaisedPreflop = true;
                }

                /* re-raise to a steal raise? */
                else if (p.IsSmallBlind && PlayerStealRaisedPreflop)
                {
                    p.IncrementRaisesToAStealRaise();
                    SmallBlindReraisedAStealRaise = true;
                }
                else if (p.IsBigBlind && PlayerStealRaisedPreflop && !SmallBlindReraisedAStealRaise)
                {
                    p.IncrementRaisesToAStealRaise();
                }

                /* From the blind raised a raise (but NOT to a reraise) ? */
                if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop)
                {
                    p.IncrementRaisesBlindToAPreflopRaise();
                }

                PlayerRaisedPreflop = true;
            }
            else if (gamePhase == HoldemGamePhase.Flop)
            {
                // Has somebody cbet?
                if (!PlayerRaisedTheFlop && PlayerCBet)
                {
                    p.IncrementRaiseToACBet();
                }

                PlayerRaisedTheFlop = true;
            }


            p.HasRaised(gamePhase);
        }