コード例 #1
0
ファイル: Board.cs プロジェクト: Jauhen/BMtoKoPS
        public void CalculateResuilts(int maxNumberOfRecords, IScoring scoringMethod)
        {
            int playedDeals = GetPlayedDeals();

            for (int i = 0; i < deals.Count; i++)
            {
                if (deals[i].HasResult())
                {
                    short  res = deals[i].result;
                    double ns  = 0;
                    double ew  = 0;
                    for (int k = 0; k < deals.Count; k++)
                    {
                        if (i != k && deals[k].HasResult())
                        {
                            short res2 = deals[k].result;
                            ns += scoringMethod.GetDiff(res, res2);
                            ew += scoringMethod.GetDiff(res2, res);
                        }
                    }
                    ns = scoringMethod.ResultReduction(ns, playedDeals, maxNumberOfRecords);
                    ew = scoringMethod.ResultReduction(ew, playedDeals, maxNumberOfRecords);

                    deals[i].SetResults(ns, ew);
                }
            }
        }
コード例 #2
0
ファイル: Board.cs プロジェクト: Jauhen/BMtoKoPS
        public void CalculateResuilts(int maxNumberOfRecords, IScoring scoringMethod)
        {
            int playedDeals = GetPlayedDeals();

              for (int i = 0; i < deals.Count; i++) {
            if (deals[i].HasResult()) {
              short res = deals[i].result;
              double ns = 0;
              double ew = 0;
              for (int k = 0; k < deals.Count; k++) {
            if (i != k && deals[k].HasResult()) {
              short res2 = deals[k].result;
              ns += scoringMethod.GetDiff(res, res2);
              ew += scoringMethod.GetDiff(res2, res);
            }
              }
              ns = scoringMethod.ResultReduction(ns, playedDeals, maxNumberOfRecords);
              ew = scoringMethod.ResultReduction(ew, playedDeals, maxNumberOfRecords);

              deals[i].SetResults(ns, ew);
            }
              }
        }