Beispiel #1
0
 //gets score for this group
 public int GetScore(bool include_bonus)
 {
     if (this.Answers.Count == 0)
     {
         return(0);
     }
     else
     {
         try
         {
             return(_Question.Scores(false)[this.Answers[0].Player] +
                    (include_bonus ? GroupBonus : 0));
         }
         catch
         {
             return(0);
         }
     }
 }
Beispiel #2
0
            //gets score for this group
            public decimal GetScore(bool include_bonus)
            {
                if (this.Answers.Count == 0)
                {
                    return(0);
                }
                else
                {
                    try
                    {
                        //not using bonus from _Question.Scores because we don't want to
                        //include individual player bonuses
                        var baseScore = _Question.Scores(false)[this.Answers[0].Player];

                        if (include_bonus)
                        {
                            if (this.BonusType == ShBonusType.Override)
                            {
                                return(this.GroupBonus);
                            }
                            else if (this.BonusType == ShBonusType.Add)
                            {
                                return(this.GroupBonus + baseScore);
                            }
                            else
                            {
                                return(baseScore);
                            }
                        }
                        else
                        {
                            return(baseScore);
                        }
                    }
                    catch
                    {
                        return(0);
                    }
                }
            }