Ejemplo n.º 1
0
        //  Makes sense to me from a modeling standpoint if we are tyring to model the nuances of an actual game - dealer runs everything.
        public void RunRound(List <Player> participants, LoanShark ls, int roundNumber)
        {
            loanShark = ls;
            List <Player> playersInRound = new List <Player>();

            playersInRound.AddRange(participants);
            dealer.PopulateDeck();
            dealer.ShuffleDeck();
            PayAntes(playersInRound);
            BetToMatch = _ante;
            Player.SetOtherPlayersBets(BetToMatch);
            foreach (var p in playersInRound)
            {
                dealer.DealPlayerCards(p);
            }

            int flips = 0;

            do
            {
                int cardsToDraw;
                if (flips == 0)
                {
                    cardsToDraw = 3;
                    DrawCommunityCards(cardsToDraw);
                }
                else
                {
                    cardsToDraw = 1;
                    DrawCommunityCards(cardsToDraw);
                }
                BettingCycle(playersInRound, flips);
                playersInRound.RemoveAll(player => player.PlayersDecision == DecisionType.Fold);
                flips++;
            } while (flips < 3 && playersInRound.Count() > 1);

            foreach (var p in playersInRound)
            {
                Console.WriteLine($"{p.PlayerName}'s Hand: ");
                p.PrintPlayerHand();
                Console.WriteLine(Environment.NewLine + $"{p.PlayerName}'s Winning Hand: {p.MyBestHand.ToString()}" + Environment.NewLine);
            }
            _roundWinners = GetWinner(playersInRound);

            DistributeWinnings(_roundWinners);
            DeleteHands(playersInRound);
            DeletePlayerCommCards();
            CommCards.Clear();
        }
Ejemplo n.º 2
0
        public void NextRound(double v, LoanShark loanShark, int roundNumber)
        {
            var nextRound = new Round(2.0);

            nextRound.RunRound(Players, loanShark, roundNumber);
        }