Responsible for one deal (one particular allocation of 32 cards to the four players including the bidding, the play of the cards and the scoring based on those cards.
예제 #1
0
        private void StartNewDeal()
        {
            this.DealNumber++;

            var dealInfo = new DealInfo {
                FirstPlayerPosition = this[this.GetFirstPlayerForTheDeal()]
            };

            foreach (var player in this.players)
            {
                player.StartNewDeal(dealInfo);
            }

            this.dealManager = new DealManager(this);

            var dealResult = this.dealManager.PlayDeal();

            // TODO: Hanging points from previous hand
            this.SouthNorthScore += dealResult.SouthNorthPoints;
            this.EastWestScore   += dealResult.EastWestPoints;

            foreach (var player in this.players)
            {
                player.EndOfDeal(dealResult);
            }

            if (dealResult.NoTricksForOneOfTheTeams)
            {
                // The game should continue when one of the teams has no tricks
                return;
            }

            if (this.SouthNorthScore >= 151 || this.EastWestScore >= 151)
            {
                this.IsGameOver = true;
            }
        }
예제 #2
0
        private void StartNewDeal()
        {
            this.dealNumber++;

            foreach (var player in this.players)
            {
                player.StartNewDeal();
            }

            this.dealManager = new DealManager(this);
            this.dealManager.PlayDeal(); // var dealResult =
            // TODO: "С капо (валат) не се излиза"
        }
        private void StartNewDeal()
        {
            this.DealNumber++;

            var dealInfo = new DealInfo { FirstPlayerPosition = this[this.GetFirstPlayerForTheDeal()] };

            foreach (var player in this.players)
            {
                player.StartNewDeal(dealInfo);
            }

            this.dealManager = new DealManager(this);

            var dealResult = this.dealManager.PlayDeal();

            // TODO: Hanging points from previous hand
            this.SouthNorthScore += dealResult.SouthNorthPoints;
            this.EastWestScore += dealResult.EastWestPoints;

            foreach (var player in this.players)
            {
                player.EndOfDeal(dealResult);
            }

            if (dealResult.NoTricksForOneOfTheTeams)
            {
                // The game should continue when one of the teams has no tricks
                return;
            }

            if (this.SouthNorthScore >= 151 || this.EastWestScore >= 151)
            {
                this.IsGameOver = true;
            }
        }
예제 #4
0
 public void StartNewDeal()
 {
     this.dealNumber++;
     this.dealManager = new DealManager(this);
     this.dealManager.StartNewDeal();
 }