コード例 #1
0
ファイル: ElkYPlayer.cs プロジェクト: Project-ElkY/Project
        /// <summary>
        /// Method that gathers information about the opposition player hand strength.
        /// </summary>
        /// <param name="context">The current context of the game.</param>
        public override void EndHand(EndHandContext context)
        {
            /*
            var openCards = context.ShowdownCards;
            if (openCards.Count != 0)
            {
                foreach (var item in openCards)
                {

                    if (item.Key != this.Name)
                    {
                        List<TexasHoldem.Logic.Cards.Card> cards = new List<TexasHoldem.Logic.Cards.Card>();
                        foreach (var card in item.Value)
                        {
                            var cardToAdd = new TexasHoldem.Logic.Cards.Card(card.Suit, card.Type);
                            cards.Add(card);
                        }

                        var opponentSrenght = InitialHandEvaluation.PreFlop(cards[0], cards[1]);
                        this.opponentStrenghtList.Add(opponentSrenght);
                    }
                }
            }
            */
            base.EndHand(context);
        }
コード例 #2
0
        public override void EndHand(EndHandContext context)
        {
            if (this.handsCount % 10 == 0)
            {
                this.otherAllInsCount = 0;
            }

            this.handsCount++;

            base.EndHand(context);
        }
コード例 #3
0
 public virtual void EndHand(EndHandContext context)
 {
 }
コード例 #4
0
 public override void EndHand(EndHandContext context)
 {
     ExecuteWithTimeLimit(TimeSpan.FromMilliseconds(50), () => base.EndHand(context));
 }
コード例 #5
0
 public virtual void EndHand(EndHandContext context)
 {
 }
コード例 #6
0
        public override void EndHand(EndHandContext context)
        {
            base.EndHand(context);

            this.LastOpponentRaise = 0;
        }
コード例 #7
0
        public override void EndHand(EndHandContext context)
        {
            if (context.ShowdownCards.Count > 0)
            {
                //var enemyCards = context.ShowdownCards.FirstOrDefault(n => !n.Key.Contains("NimoaPlayer")).Value.ToList();
                var enemyCards = context.ShowdownCards[this.enemyName].ToList();
                // var myHand = context.ShowdownCards[this.Name].Concat(this.CommunityCards);
                // var enemyHand = enemyCards.Concat(this.CommunityCards);
                if (this.enemyCardsPrediction != null)
                {
                    this.enemyCardsPredictionMisses++;
                    foreach (var cards in this.enemyCardsPrediction)
                    {
                        if (cards.Contains(enemyCards[0]) && cards.Contains(enemyCards[1]))
                        {
                            this.enemyCardsPredictionHits++;
                            this.enemyCardsPredictionMisses--;
                            break;
                        }
                    }

                    var enemyOdds = HandStrengthValuation.PreFlopOdsLookupTable(enemyCards[0], enemyCards[1]);

                    if (this.enemyRising)
                    {
                        EnemyPredictions.MinBetThreshold = Math.Min(EnemyPredictions.MinBetThreshold, enemyOdds);
                    }
                    else
                    {
                        EnemyPredictions.MaxCallThreshold = Math.Max(EnemyPredictions.MaxCallThreshold, enemyOdds);
                    }
                }

                //var gameResult = (EndGameState)Logic.Helpers.Helpers.CompareCards(enemyHand, myHand);
                // per round enemy accuracy statistics (too many games required! Potentially slow!)
                /*foreach (var round in this.thisHandEnemyRising)
                {
                    if (!this.enemyGuessesPerRound.ContainsKey(round.Key))
                    {
                        this.enemyGuessesPerRound.Add(round.Key, new List<EndGameState>());
                    }

                    if (round.Value)
                    {
                        this.enemyGuessesPerRound[round.Key].Add(gameResult);

                        if (this.enemyGuessesPerRound[round.Key].Count >= 300)
                        {
                            var enemyVictoriesCount = this.enemyGuessesPerRound[round.Key].Count(h => h == EndGameState.Win);
                            var drawsCount = this.enemyGuessesPerRound[round.Key].Count(h => h == EndGameState.Draw);
                            var enemyLosesCount = this.enemyGuessesPerRound[round.Key].Count(h => h == EndGameState.Loose);

                            if (!this.enemyAccuracyPerRound.ContainsKey(round.Key))
                            {
                                this.enemyAccuracyPerRound.Add(round.Key, 0);
                            }

                            this.enemyAccuracyPerRound[round.Key] = (enemyVictoriesCount + ((float)drawsCount / 2)) / (enemyVictoriesCount + drawsCount + enemyLosesCount);
                        }
                    }
                }*/
            }

            base.EndHand(context);
        }