Exemple #1
0
        private void catchUpActionsFromServer(Dictionary <Street, List <MatchState.ActionInfo> > newBetting, HoleCards heroHoleCards)
        {
            Street street         = _botGameState.getStreet();
            int    prevNumActions = (_prevMatchState.betting.ContainsKey(street)) ? _prevMatchState.betting[street].Count : 0;
            int    nextNumActions = (newBetting.ContainsKey(street)) ? newBetting[street].Count : 0;

            // CatchUp with the actions...
            for (int i = prevNumActions; i < nextNumActions; i++)
            {
                var action          = newBetting[street][i];
                var playerToActName = _botGameState.getPlayerToAct().Name;

                var byAmmount = action.Amount - _botGameState.getPlayerToAct().MoneyInPot;
                _botGameState.playerActs(action.Type, byAmmount);

                var heroGuess = hero().Range.getHoleCardsProb(_prevMatchState.heroHoleCards()) * 100;
                Console.Write("Server says: " + playerToActName + " " + action.Type.ToString() + "s");

                if (playerToActName == "Hero")
                {
                    Console.Write(" [Hole Cards Guess: " + heroGuess.ToString("f1") + "%]");
                }

                if (action.Amount > 0)
                {
                    Console.WriteLine(" to " + action.Amount.ToString());
                }
                else
                {
                    Console.WriteLine("");
                }
            }
        }
Exemple #2
0
        private EstimatedAD getPlayerToActAD(Player playerToAct, BotGameState gameState)
        {
            if (gameState.getStreet() == Street.PreFlop)
            {
                var preFlopParams = new PreFlopParams(
                    gameState.getTableType(),
                    playerToAct.PreFlopPosition,
                    gameState.getNumCallers(),
                    gameState.getNumBets(),
                    gameState.numActivePlayers(),
                    playerToAct.LastAction,
                    gameState.isPlayerInPosition(gameState.getPlayerToActInd()));

                return(playerToAct.GetAD(preFlopParams));
            }
            else
            {
                var        round      = playerToAct.Round();
                ActionType prevAction = (round == 0) ? playerToAct.PrevStreetAction : playerToAct.LastAction;

                var postFlopParams = new PostFlopParams(
                    gameState.getTableType(),
                    gameState.getStreet(),
                    round,
                    prevAction,
                    gameState.getNumBets(),
                    gameState.isPlayerInPosition(gameState.getPlayerToActInd()),
                    gameState.numActivePlayers());

                return(playerToAct.GetAD(postFlopParams));
            }
        }
Exemple #3
0
 void IActionEstimator.newStreet(BotGameState gameState)
 {
     if (gameState.getStreet() == Street.Flop)
     {
         DecisionMakingDll.GameContext_NewFlop(_dmContext, gameState.getBoard(), gameState.getHeroHoleCards());
     }
 }
Exemple #4
0
 void IActionEstimator.estimateEV(out float checkCallEV, out float betRaiseEV, BotGameState gameState)
 {
     DecisionMakingDll.Holdem_EstimateEV(out checkCallEV, out betRaiseEV, gameState.getButtonInd(),
                                         gameState.getHeroInd(),
                                         gameState.getHeroHoleCards(),
                                         gameState.getPlayers(),
                                         gameState.getBoard(),
                                         gameState.getStreet(),
                                         gameState.getNumBets(),
                                         gameState.getNumCallers(),
                                         gameState.getBigBlingSize(), _dmContext);
 }
Exemple #5
0
        void IActionEstimator.newAction(ActionType actionType, BotGameState gameState)
        {
            float betRaiseProb  = 0.0f;
            float checkCallProb = 0.0f;

            getPlayerToActAD(ref betRaiseProb, ref checkCallProb, gameState);

            gameState.getPlayerToAct().CutRange(actionType,
                                                gameState.getStreet(),
                                                gameState.getBoard(),
                                                betRaiseProb,
                                                checkCallProb, _dmContext);
        }