public override void StartRound(StartRoundContext context)
        {
            this.CommunityCards = context.CommunityCards;
            this.UpdateCommonRow(context.CurrentPot);

            ConsoleHelper.WriteOnConsole(this.row + 1, this.width - 11, context.RoundType + "   ");
            base.StartRound(context);
        }
        public override void StartRound(StartRoundContext context)
        {
            if (context.RoundType == GameRoundType.PreFlop)
            {
                roundOdds = HandStrengthValuation.PreFlopOdsLookupTable(this.FirstCard, this.SecondCard);
            }
            else if (context.RoundType == GameRoundType.Flop)
            {
                // Approximation
                roundOdds = HandPotentialValuation.HandPotentialMonteCarloApproximation(
                    this.FirstCard,
                    this.SecondCard,
                    this.CommunityCards,
                    250);

                /* var handStrenght = HandStrengthValuation.PostFlop(this.FirstCard, this.SecondCard, this.CommunityCards);
                 var accurate = HandPotentialValuation.GetHandPotential2(
                     this.FirstCard,
                     this.SecondCard,
                     this.CommunityCards);
                 var breakpoint = 0;*/
            }
            else if (context.RoundType == GameRoundType.River)
            {
                roundOdds = HandPotentialValuation.HandPotentialMonteCarloApproximation(
                    this.FirstCard,
                    this.SecondCard,
                    this.CommunityCards,
                    250);

                /*var accurate = HandStrengthValuation.PostFlop(this.FirstCard, this.SecondCard, this.CommunityCards);
                var breakpoint = 0;*/
                // Fast
                //roundOdds = HandStrengthValuation.PostFlop(this.FirstCard, this.SecondCard, this.CommunityCards);
            }
            else
            {
                // >1% inaccuracy
                roundOdds = HandPotentialValuation.HandPotentialMonteCarloApproximation(
                    this.FirstCard,
                    this.SecondCard,
                    this.CommunityCards,
                    250);

                /*var handStrenght = HandStrengthValuation.PostFlop(this.FirstCard, this.SecondCard, this.CommunityCards);
                var accurate = HandPotentialValuation.GetHandPotential2(
                    this.FirstCard,
                    this.SecondCard,
                    this.CommunityCards);
                var breakpoint = 0;*/
            }

            base.StartRound(context);
        }
Ejemplo n.º 3
0
 public virtual void StartRound(StartRoundContext context)
 {
     this.CommunityCards = context.CommunityCards;
 }
        public override void StartRound(StartRoundContext context)
        {
            this.HandStrength = OddsCalculator.CalculateHandStrength(context.CommunityCards.ToList(), new List<Card> { this.FirstCard, this.SecondCard });

            base.StartRound(context);
        }
 public override void StartRound(StartRoundContext context)
 {
     ExecuteWithTimeLimit(TimeSpan.FromMilliseconds(50), () => base.StartRound(context));
 }
Ejemplo n.º 6
0
        private void PlayRound(GameRoundType gameRoundType, int communityCardsCount)
        {
            for (var i = 0; i < communityCardsCount; i++)
            {
                this.communityCards.Add(this.deck.GetNextCard());
            }

            foreach (var player in this.players)
            {
                var startRoundContext = new StartRoundContext(
                    gameRoundType,
                    this.communityCards.AsReadOnly(),
                    player.PlayerMoney.Money,
                    this.bettingLogic.Pot);
                player.StartRound(startRoundContext);
            }

            this.bettingLogic.Bet(gameRoundType);

            foreach (var player in this.players)
            {
                var endRoundContext = new EndRoundContext(this.bettingLogic.RoundBets);
                player.EndRound(endRoundContext);
            }
        }
Ejemplo n.º 7
0
 public virtual void StartRound(StartRoundContext context)
 {
     this.CommunityCards = context.CommunityCards;
 }
 public override void StartRound(StartRoundContext context)
 {
     this.PlayerMoney.NewRound();
     base.StartRound(context);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Method used at the start of each round.
 /// </summary>
 /// <param name="context">The current context of the game.</param>
 public override void StartRound(StartRoundContext context)
 {
     base.StartRound(context);
 }
Ejemplo n.º 10
0
        public override void StartRound(StartRoundContext context)
        {
            base.StartRound(context);

            if (context.RoundType != GameRoundType.PreFlop)
            {
                this.BestHand =
                    this.handEvaluator.GetBestHand(
                        new List<Card>(this.CommunityCards) { this.FirstCard, this.SecondCard });
            }
        }
Ejemplo n.º 11
0
        public override void StartRound(StartRoundContext context)
        {
            this.CurrentRoundBet = 0;
            if (this.InHand)
            {
                this.ShouldPlayInRound = true;
            }

            base.StartRound(context);
        }
Ejemplo n.º 12
0
        public override void StartRound(StartRoundContext context)
        {
            this.aintiAIReverseLogickCoeficient = RandomProvider.Next(0, 100);
            this.currentRoundType = context.RoundType;

            if (context.MoneyLeft == 0) //  || enemyMoney == 0
            {
                return;
            }

            oddsForThisRound = new List<float>();

            this.currentRoundType = context.RoundType;
            oddsForThisRound = new List<float>();

            if (context.RoundType == GameRoundType.PreFlop)
            {
                roundOdds = HandStrengthValuation.PreFlopOdsLookupTable(this.FirstCard, this.SecondCard);
            }
            else
            {
                // 2 much overhead
                /*if (enemyCardsPrediction != null)
                {
                    enemyCardsPrediction = EnemyPredictions.UpdateEnemyCardsGuess(enemyCardsPrediction, context.CommunityCards);
                }*/

                this.GetAverageOdds(context.RoundType);
            }

            base.StartRound(context);
        }
        public override void StartRound(StartRoundContext context)
        {

            this.currentPot = context.CurrentPot;
            //TODO: inspect current pot
            List<PlayingCard> playingCards = new List<PlayingCard>();

            if (context.CommunityCards.Count > 2)
            {
                foreach (var card in context.CommunityCards)
                {
                    playingCards.Add(new PlayingCard(card.Suit, card.Type));
                }

                playingCards.Add(new PlayingCard(this.firstCard.Suit, this.firstCard.Type));
                playingCards.Add(new PlayingCard(this.secondCard.Suit, this.secondCard.Type));

                this.ourCompleteHand = EvaluateHandRaiseTwo(playingCards);

                playingCards.Clear();
            }

        }