コード例 #1
0
        private void PlayGame()
        {
            var shifted = this.allPlayers.ToList();

            // While at least two players have money
            while (this.allPlayers.Count(x => x.PlayerMoney.Money > 0) > 1)
            {
                this.HandsPlayed++;

                // Every 10 hands the blind increases
                // var smallBlind = SmallBlinds[(this.HandsPlayed - 1) / 10];
                var smallBlind = SmallBlinds[0];

                // Players are shifted in order of priority to make a move
                shifted.Add(shifted.First());
                shifted.RemoveAt(0);

                // Rotate players
                IHandLogic hand = new HandLogic(shifted, this.HandsPlayed, smallBlind);

                hand.Play();

                this.Rebuy();
            }
        }
コード例 #2
0
 public void Start()
 {
     while (this.AtLeastTwoPlayersHaveMoney())
     {
         this.roundNumber++;
         var hand = new HandLogic(this.players, this.roundNumber);
         hand.Play();
     }
 }