Ejemplo n.º 1
0
        public int GetLigneScoreTotal()
        {
            ScoringSysteme scoringSysteme = this.ScoreCard.Evenement.ScoringSysteme;

            if (this.typeLigneScore == typeLigneScore.UP)
            {
                return(this.front * scoringSysteme.frontPlus + this.back * scoringSysteme.backPlus + this.gun * scoringSysteme.gunPlus + this.shoulder * scoringSysteme.shoulderPlus);
            }
            else
            {
                return(this.front * scoringSysteme.frontMoins + this.back * scoringSysteme.backMoins + this.gun * scoringSysteme.gunMoins + this.shoulder * scoringSysteme.shoulderMoins);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// calcul le score dynamiquement
        /// </summary>
        /// <param name="scs"></param>
        /// <returns></returns>
        public int calculScore(ScoringSysteme scs)
        {
            if (scs == null)
            {
                return(0);
            }
            int score = 0;

            foreach (LigneScore l in this.LigneScore)
            {
                if (l.typeLigneScore == typeLigneScore.UP)
                {
                    score += l.front * scs.frontPlus + l.back * scs.backPlus + l.gun * scs.gunPlus + l.shoulder * scs.shoulderPlus;
                }
                else
                {
                    score -= (l.front * scs.frontMoins + l.back * scs.backMoins + l.gun * scs.gunMoins + l.shoulder * scs.shoulderMoins);
                }
            }
            int r = (ratio > scs.ratioMax) ? scs.ratioMax : ratio;

            score += ratio * scs.ratioPts;
            return(score);
        }