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