Beispiel #1
0
 public override PlayerAction GetTurn(GetTurnContext context)
 {
     if (context.MoneyLeft <= 250)
     {
         // CLOSE to LOOSING The Game - PLay aggresivly to return back the stack
         var preFlopCards = CustomHandEvaluator.PreFlopAggressive(context, this.FirstCard, this.SecondCard);
         var firstCard = this.FirstCard;
         var secondCard = this.SecondCard;
         var communityCards = this.CommunityCards;
         return CustomStackActions.NormalStackMethod(context, preFlopCards, firstCard, secondCard, communityCards);
     }
     else if (context.MoneyLeft > 250 && context.MoneyLeft < 1750)
     {
         var preFlopCards = CustomHandEvaluator.PreFlop(context, this.FirstCard, this.SecondCard);
         var firstCard = this.FirstCard;
         var secondCard = this.SecondCard;
         var communityCards = this.CommunityCards;
         return CustomStackActions.NormalStackMethod(context, preFlopCards, firstCard, secondCard, communityCards);
     }
     else
     {
         // context.MoneyLeft > 1600 we are CHIPLEADERS - FIGHT With AGRESSION!
         var preFlopCards = CustomHandEvaluator.PreFlopAggressive(context, this.FirstCard, this.SecondCard);
         var firstCard = this.FirstCard;
         var secondCard = this.SecondCard;
         var communityCards = this.CommunityCards;
         return CustomStackActions.NormalStackMethod(context, preFlopCards, firstCard, secondCard, communityCards);
     }
 }
Beispiel #2
0
        public override PlayerAction GetTurn(GetTurnContext context)
        {
            var preFlopCards = CustomHandEvaluator.PreFlop(context, this.FirstCard, this.SecondCard);

            List <Card> currentCards = new List <Card>();

            currentCards.Add(this.FirstCard);
            currentCards.Add(this.SecondCard);

            if (context.RoundType == GameRoundType.PreFlop)
            {
                if (preFlopCards == CardValueType.Unplayable)
                {
                    return(CheckOrFoldCustomAction(context));
                }

                if (preFlopCards == CardValueType.Risky || preFlopCards == CardValueType.NotRecommended)
                {
                    if (preFlopCards == CardValueType.NotRecommended && context.MoneyToCall > context.SmallBlind * 11)
                    {
                        return(CheckOrFoldCustomAction(context));
                    }

                    if (preFlopCards == CardValueType.Risky && context.MoneyToCall > context.SmallBlind * 21)
                    {
                        return(CheckOrFoldCustomAction(context));
                    }

                    return(PlayerAction.Raise(context.SmallBlind * 3));
                }

                if (preFlopCards == CardValueType.Recommended)
                {
                    return(PlayerAction.Raise(context.SmallBlind * 6));
                }

                return(PlayerAction.CheckOrCall());
            }
            else if (context.RoundType == GameRoundType.Flop)
            {
                // TODO
                // add strong logic for FLOP
                // (do we have good card conmbination from our 2 cards and the floppef 3 cards)
                // иif we have already played aggresivly (all-in) we should check/call
                // if NOT god combination - we can check or fold
                // if strong combination we can put more agressiong and raise/all-in
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotStrongHand(combination))
                {
                    if (preFlopCards == CardValueType.Recommended && context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.MoneyLeft));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else
                {
                    return(CheckOrFoldCustomAction(context));
                }
            }
            else if (context.RoundType == GameRoundType.Turn)
            {
                // TODO
                // add strong logic for FLOP
                // (do we have good card conmbination from our 2 cards and the floppef 4 cards)
                // иif we have already played aggresivly (all-in) we should check/call
                // if NOT god combination - we can check or fold
                // if strong combination we can put more agressiong and raise/all-in
                currentCards.Clear();
                currentCards.Add(this.FirstCard);
                currentCards.Add(this.SecondCard);
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotStrongHand(combination))
                {
                    if (preFlopCards == CardValueType.Recommended && context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.MoneyLeft));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else
                {
                    return(CheckOrFoldCustomAction(context));
                }
            }
            else
            {
                // GameRoundType.River (final card)
                // TODO
                // add strong logic for FLOP
                // (do we have good card conmbination from our 2 cards and the floppef 5 cards)
                // иif we have already played aggresivly (all-in) we should check/call
                // if NOT god combination - we can check or fold
                // if strong combination we can put more agressiong and raise/all-in
                currentCards.Clear();
                currentCards.Add(this.FirstCard);
                currentCards.Add(this.SecondCard);
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotVeryStrongHand(combination))
                {
                    if (context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.MoneyLeft));
                    }

                    return(PlayerAction.Raise(context.CurrentPot * 2));
                }
                else
                {
                    if (GotStrongHand(combination))
                    {
                        if (preFlopCards == CardValueType.Recommended && context.MoneyLeft > 0)
                        {
                            return(PlayerAction.Raise(context.MoneyLeft));
                        }

                        return(PlayerAction.CheckOrCall());
                    }
                    else
                    {
                        return(CheckOrFoldCustomAction(context));
                    }
                }
            }
        }
        public override PlayerAction GetTurn(GetTurnContext context)
        {
            var preFlopCards = CustomHandEvaluator.PreFlop(context, this.FirstCard, this.SecondCard);

            List <Card> currentCards = new List <Card>();

            currentCards.Add(this.FirstCard);
            currentCards.Add(this.SecondCard);

            if (context.RoundType == GameRoundType.PreFlop)
            {
                if (preFlopCards == CardValueType.Unplayable)
                {
                    return(CheckOrFoldCustomAction(context));
                }

                if (preFlopCards == CardValueType.Risky || preFlopCards == CardValueType.NotRecommended)
                {
                    if (preFlopCards == CardValueType.NotRecommended && context.MoneyToCall > context.SmallBlind * 7)
                    {
                        return(CheckOrFoldCustomAction(context));
                    }

                    if (preFlopCards == CardValueType.Risky && context.MoneyToCall > context.SmallBlind * 15)
                    {
                        return(CheckOrFoldCustomAction(context));
                    }

                    return(PlayerAction.CheckOrCall());
                }

                if (preFlopCards == CardValueType.Recommended && context.MoneyLeft > 0)
                {
                    return(PlayerAction.Raise(context.MoneyLeft));
                }

                return(PlayerAction.CheckOrCall());
            }
            else if (context.RoundType == GameRoundType.Flop)
            {
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotStrongHand(combination))
                {
                    if (GotVeryStrongHand(combination))
                    {
                        if (context.MoneyLeft > 0)
                        {
                            return(PlayerAction.Raise(context.CurrentPot * 3));
                        }

                        return(PlayerAction.CheckOrCall());
                    }
                    else if (context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.CurrentPot * 2));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else
                {
                    return(CheckOrFoldCustomAction(context));
                }
            }
            else if (context.RoundType == GameRoundType.Turn)
            {
                currentCards.Clear();
                currentCards.Add(this.FirstCard);
                currentCards.Add(this.SecondCard);
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotVeryStrongHand(combination))
                {
                    if (context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.MoneyLeft));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else if (GotStrongHand(combination))
                {
                    if (context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.SmallBlind * 8));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else
                {
                    if (context.MoneyToCall < context.SmallBlind * 2.5 || context.MoneyLeft < context.SmallBlind * 2.5)
                    {
                        return(PlayerAction.CheckOrCall());
                    }

                    return(CheckOrFoldCustomAction(context));
                }
            }
            else // GameRoundType.River (final card)
            {
                currentCards.Clear();
                currentCards.Add(this.FirstCard);
                currentCards.Add(this.SecondCard);
                currentCards.AddRange(this.CommunityCards);

                var combination = Logic.Helpers.Helpers.GetHandRank(currentCards);

                if (GotVeryStrongHand(combination))
                {
                    if (context.MoneyLeft > 0)
                    {
                        return(PlayerAction.Raise(context.MoneyLeft));
                    }

                    return(PlayerAction.CheckOrCall());
                }
                else
                {
                    if (GotStrongHand(combination))
                    {
                        if (preFlopCards == CardValueType.Recommended && context.MoneyLeft > 0)
                        {
                            return(PlayerAction.Raise(context.MoneyLeft));
                        }

                        return(PlayerAction.CheckOrCall());
                    }
                    else
                    {
                        if (context.MoneyToCall < context.SmallBlind * 2 || context.MoneyLeft > context.SmallBlind * 10)
                        {
                            return(PlayerAction.CheckOrCall());
                        }

                        return(CheckOrFoldCustomAction(context));
                    }
                }
            }
        }