Exemple #1
0
        /// <summary>
        /// Gets the bets from all the players still in the hand.
        /// </summary>
        public void GetBets(List <Action> curRoundActions)
        {
            bool roundOver = false;

            HandAnalysis[] analysis = new HandAnalysis[seats.Length];

            int pIdx = GetFirstToAct(history.CurrentRound == Round.Preflop);

            //keep getting bets until the round is over
            while (!roundOver)
            {
                history.CurrentBetLevel = betManager.BetLevel;
                history.Pot             = potManager.Total;
                history.Hero            = pIdx;

                //get the next player's action
                Action.ActionTypes actionType; double amount;
                if (analysis[pIdx] == null && AnalyzeHands)
                {
                    analysis[pIdx] = cache != null
                                     ? cache.GetAnalysis(pIdx, betManager.In - 1, history.CurrentRound)
                                     : new HandAnalysis(history.HoleCards[pIdx], history.Board, betManager.In - 1);
                }

                seats[pIdx].Brain.GetAction(history, out actionType, out amount);

                AddAction(pIdx, new Action(seats[pIdx].Name, actionType, amount), curRoundActions);

                roundOver = betManager.RoundOver;

                pIdx = playerIndices.Next;
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets the bets from all the players still in the hand.
        /// </summary>
        public void GetBets(List<Action> curRoundActions)
        {
            bool roundOver = false;
            HandAnalysis[] analysis = new HandAnalysis[seats.Length];

            int pIdx = GetFirstToAct(history.CurrentRound == Round.Preflop);

            //keep getting bets until the round is over
            while (!roundOver)
            {
                history.CurrentBetLevel = betManager.BetLevel;
                history.Pot = potManager.Total;
                history.Hero = pIdx;

                //get the next player's action
                Action.ActionTypes actionType; double amount;
                if (analysis[pIdx] == null && AnalyzeHands)
                    analysis[pIdx] = cache != null
                                     ? cache.GetAnalysis(pIdx, betManager.In - 1, history.CurrentRound)
                                     : new HandAnalysis(history.HoleCards[pIdx], history.Board, betManager.In - 1);

                seats[pIdx].Brain.GetAction(history, out actionType, out amount);

                AddAction(pIdx, new Action(seats[pIdx].Name, actionType, amount), curRoundActions);

                roundOver = betManager.RoundOver;

                pIdx = playerIndices.Next;
            }
        }