Exemple #1
0
        /// <summary>
        /// Handles the cases with all possible betting scenarios.
        /// </summary>
        public void UseABetHandler()
        {
            if (this.IndexLastRaised == this.IndexLastChecked && !this.Database.RoundType.Equals(CommunityCardRound.River))
            {
                ICommunityRoundHandler roundHandler = new CommunityRoundHandler();
                roundHandler.AdvanceRounds();
            }
            else if (((this.IndexLastChecked == this.IndexLastRaised) && this.Database.RoundType == CommunityCardRound.River) ||
                     (this.Database.LeftPlayersCount - this.Database.FoldedPlayersCount == 1))
            {
                IWinnersFixer winnerFixer = new WinnersFixer(this.Database);
                winnerFixer.CheckWinners();
            }
            else if (this.Database.LeftPlayersCount - this.Database.FoldedPlayersCount - this.Database.AllInPlayersCount <= 1 &&
                     this.Database.AllInPlayersCount >= 1)
            {
                while (!this.Database.RoundType.Equals(CommunityCardRound.River))
                {
                    ICommunityRoundHandler roundHandler = new CommunityRoundHandler();
                    roundHandler.AdvanceRounds();
                }

                IWinnersFixer winnerFixer = new WinnersFixer(this.Database);
                winnerFixer.CheckWinners();
            }
        }
Exemple #2
0
        public void UseABetHandler()
        {
            if (this.IndexLastChecked == this.IndexLastRaised)
            {
                ICommunityRoundHandler roundHandler = new CommunityRoundHandler();
                roundHandler.AdvanceRounds();
            }

            else if (this.Database.PlayersNotFoldedOrAllIn.Where(x => x != null).Count() == 1)

            {
                IWinnersFixer winnerFixer = new WinnersFixer();
                winnerFixer.CheckWinners();
            }
        }