Esempio n. 1
0
        public static int RunStrategy(GameState gameState)
        {
            var player = gameState.Players.Single(p => p.Name == TeamName);

            var betRound = gameState.BetIndex / gameState.Players.Count;

            if (gameState.Round < 20)
            {
                return(0);
            }

            var isHeadsUp = IsHeadsUp(gameState);
            var shouldPlayMoreAggressive = ShouldPlayMoreAggressive(gameState, player);

            if (IsFirstBet(gameState))
            {
                if (HoleCard.IsHigh(player.Cards[0], player.Cards[1], shouldPlayMoreAggressive, isHeadsUp))
                {
                    return(betRound <= 1
                        ? GetMinimumRaiseBetTimes(gameState, player.Bet, 1)
                        : GetMinimumRaiseBetTimes(gameState, player.Bet, 0));
                }
            }
            else
            {
                var score = HoleCard.GetScore(player.Cards, gameState.CommunityCards);
                if (score > 0)
                {
                    return(betRound <= 1
                        ? GetMinimumRaiseBetTimes(gameState, player.Bet, score)
                        : GetMinimumRaiseBetTimes(gameState, player.Bet, 0));
                }
            }

            return(0);
        }
 public Card(HoleCard holdCard)
 {
     Rank = GetRankEnum(holdCard.rank);
     Suit = GetSuitEnum(holdCard.suit);
 }