Beispiel #1
0
        /// <summary>
        /// Calls methods for the bot to make its choice and accomplish its turn.
        /// </summary>
        /// <param name="player">The bot.</param>
        /// <param name="index">Internal index for accessing the player(bot).</param>
        private void BotTakesTurn(IPlayer player, int index)
        {
            IHandChecker handChecker = new HandChecker();

            handChecker.CheckHands(player);

            MessageBox.Show(string.Format("Bot {0}'s Turn", index));
            IBotHandler botHandler = new BotHandler(this.PokerTable, index);

            botHandler.Execute();
        }
Beispiel #2
0
        /// <summary>
        /// Method that determines which hands are competing.
        /// </summary>
        /// <returns>IList of IHands</returns>
        private IList <IHand> CompareBestHands()
        {
            var           players        = this.Database.Players.Where(x => !x.Bet.Equals(BetOptions.Fold));
            IHandChecker  handChecker    = new HandChecker();
            IList <IHand> competingHands = new List <IHand>();

            foreach (var player in players)
            {
                if (player != null)
                {
                    handChecker.CheckHands(player);
                    competingHands.Add(player.Hand);
                }
            }

            return(competingHands);
        }