コード例 #1
0
ファイル: Score.cs プロジェクト: whitemanthedj/BridgeBackEnd
        public ScorePad(int dealerIndex, Player[] allPlayers)
        {
            int nummaOfPlayers = allPlayers.Length;
            int acrossTable    = nummaOfPlayers / 2 + dealerIndex;

            this.we   = new PartnerScore(allPlayers[dealerIndex], allPlayers[(acrossTable) % nummaOfPlayers]);
            this.they = new PartnerScore(allPlayers[(dealerIndex + 1) % nummaOfPlayers], allPlayers[(acrossTable + 1) % nummaOfPlayers]);
        }
コード例 #2
0
ファイル: Score.cs プロジェクト: whitemanthedj/BridgeBackEnd
 private static void HandleScores(PartnerScore bidders, PartnerScore opponent, Bid finalContract, int netTricks)
 {
     if (ContractWasMade(netTricks))
     {
         // bidders got enough triks
         bidders.addScore(netTricks, finalContract.TricksNeeded() - book, finalContract, bidders.Vulnerable());
     }
     else
     {
         // bidders went down tricks
         opponent.addScore(Math.Abs(netTricks), bidders.Vulnerable(), finalContract);
     }
     if (bidders.GotGame())
     {
         int increase = (bidders.BelowRecord().Count > opponent.BelowRecord().Count ? bidders.BelowRecord().Count: opponent.BelowRecord().Count);
         // Use that to increase the the count of both scores by ^
         bidders.GetAGame(increase);
         opponent.UpdateAboveLine(increase);
     }
 }