コード例 #1
0
        void handHistoryParser_PlayerBet(string playerName, float amount, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

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


            // Flop
            if (gamePhase == HoldemGamePhase.Flop && !PlayerBetTheFlop)
            {
                // Did he raised preflop?
                if (p.HasPreflopRaisedThisRound())
                {
                    p.IncrementOpportunitiesToCBet(true);
                    PlayerCBet = true;
                }

                PlayerBetTheFlop = true;
            }


            p.HasBet(gamePhase);
        }
コード例 #2
0
        void handHistoryParser_PlayerChecked(string playerName, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

            // On some clients, a player who is sitting out might be automatically made to check
            if (p == null)
            {
                Trace.WriteLine("Check 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();
                }

                PlayerCheckedPreflop = true;
            }

            // Flop
            if (gamePhase == HoldemGamePhase.Flop && !PlayerBetTheFlop && p.HasPreflopRaisedThisRound())
            {
                p.IncrementOpportunitiesToCBet(false);
            }

            p.HasChecked(gamePhase);
        }
コード例 #3
0
        void HoldemTableStatistics_PlayerPushedAllIn(string playerName, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

            Trace.WriteLine("Pushed all-in: " + p.Name);
            p.HasPushedAllIn(gamePhase);
        }
コード例 #4
0
ファイル: Hud.cs プロジェクト: visualjc/PokerMuck
        public void holdemWindow_OnPlayerPreflopPushingRangeNeedToBeDisplayed(HoldemHudWindow sender)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayerAssociatedWith((HudWindow)sender);

            if (p != null)
            {
                p.DisplayPreflopPushingRangeWindow();
            }
        }
コード例 #5
0
        void handHistoryParser_PlayerCalled(string playerName, float amount, HoldemGamePhase gamePhase)
        {
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

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


            // If we are preflop
            if (gamePhase == HoldemGamePhase.Preflop)
            {
                // If the call is the same amount as the big blind, this is also a limp
                if (amount == BigBlindAmount)
                {
                    PlayerLimpedPreflop = true;

                    // HasLimped() makes further checks to avoid duplicate counts and whether the player is the big blind or small blind
                    p.CheckForLimp();
                }

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

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

                /* From the blind called a raise (but NOT to a reraise) ? */
                if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop)
                {
                    p.IncrementCallsBlindToAPreflopRaise();
                }
            }
            else if (gamePhase == HoldemGamePhase.Flop)
            {
                // Has somebody cbet?
                if (!PlayerRaisedTheFlop && PlayerCBet)
                {
                    p.IncrementCallToACBet();
                }
            }

            p.HasCalled(gamePhase);
        }
コード例 #6
0
        void handHistoryParser_FoundSmallBlind(String playerName)
        {
            // Keep track of who is the small blind
            HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName);

            if (p != null)
            {
                p.IsSmallBlind = true;
            }
        }
コード例 #7
0
        void HoldemTableStatistics_FoundWinner(string playerName)
        {
            HoldemPlayer winnerPlayer = (HoldemPlayer)FindPlayer(playerName);

            foreach (HoldemPlayer p in table.PlayerList)
            {
                if (winnerPlayer == p && winnerPlayer.WentToShowdownThisRound())
                {
                    Trace.WriteLine("Winner at showdown: " + p.Name);
                    p.IncrementWonAtShowdown();
                }
            }
        }
コード例 #8
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);
        }
コード例 #9
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);
        }