示例#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;
            }
        }
 public void StartNewDeal(DealInfo dealInfo)
 {
     this.hand.Clear();
     this.Contract = new Contract();
     this.Deal = dealInfo;
     this.Draw();
 }
        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;
            }
        }
 public void StartNewDeal(DealInfo dealInfo)
 {
     this.hand.Clear();
 }
 public void StartNewDeal(DealInfo dealInfo)
 {
     //throw new NotImplementedException();
 }