Example #1
0
 /// <summary>
 /// Add a score to the scores list
 /// </summary>
 /// <param name="score"></param>
 public void AddScore(UserScore score)
 {
     try
     {
         scores.Add(score);
         scores.Sort();
         scores.Reverse();
     }
     catch (Exception ex)
     {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." +
                             MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
     }
 }
Example #2
0
        /// <summary>
        /// The constructor after a game
        /// </summary>
        public HighScores(HighScoreLogic highScores, UserScore score)
        {
            try
            {
                this.highScores = highScores;

                InitializeComponent();

                FillHighScores();

                lblYourScore.Visibility = Visibility.Visible;
                lblCurrentScore.Content = score.ToString();
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }