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.
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 4
0
 public void StartNewDeal()
 {
     this.dealNumber++;
     this.dealManager = new DealManager(this);
     this.dealManager.StartNewDeal();
 }