Exemplo n.º 1
0
        /// <summary>
        ///     Calculates score for a given object. Essentially it just calcs for the next Hitstat.
        /// </summary>
        internal void CalculateScoreForNextObject()
        {
            if (Type == ScoreboardUserType.Self)
            {
                Score.Text = $"{RatingProcessor.CalculateRating(Processor.Accuracy):0.00} / {StringHelper.AccuracyToString(Processor.Accuracy)}";
                Combo.Text = Processor.Combo.ToString("N0") + "x";

                SetTintBasedOnHealth();
                return;
            }

            // If the user doesn't have any more judgements then don't update them.
            if (Judgements.Count - 1 < CurrentJudgement)
            {
                return;
            }

            var processor = (ScoreProcessorKeys)Processor;

            processor.CalculateScore(Judgements[CurrentJudgement]);

            SetTintBasedOnHealth();

            Score.Text = $"{RatingProcessor.CalculateRating(Processor.Accuracy):0.00} / {StringHelper.AccuracyToString(Processor.Accuracy)}";
            Combo.Text = Processor.Combo.ToString("N0") + "x";

            CurrentJudgement++;
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Updates the values and positions of the score and accuracy displays.
 /// </summary>
 public void UpdateScoreAndAccuracyDisplays()
 {
     // Update score and accuracy displays
     ScoreDisplay.UpdateValue(Screen.Ruleset.ScoreProcessor.Score);
     RatingDisplay.UpdateValue(RatingProcessor.CalculateRating(Screen.Ruleset.ScoreProcessor.Accuracy));
     AccuracyDisplay.UpdateValue(Screen.Ruleset.ScoreProcessor.Accuracy);
 }
Exemplo n.º 3
0
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public double CalculateRating()
        {
            var rating = RatingProcessor.CalculateRating(Processor.Accuracy);

            if (Processor.MultiplayerProcessor != null)
            {
                if (OnlineManager.CurrentGame != null && OnlineManager.CurrentGame.Ruleset != MultiplayerGameRuleset.Battle_Royale &&
                    (Processor.MultiplayerProcessor.IsRegeneratingHealth || Processor.MultiplayerProcessor.IsEliminated))
                {
                    rating = 0;
                }
            }

            return(rating);
        }
Exemplo n.º 4
0
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public double CalculateRating()
        {
            var oldProcessor = Processor;

            if (Type == ScoreboardUserType.Self)
            {
                Processor = Screen.Ruleset.StandardizedReplayPlayer.ScoreProcessor;
            }

            var rating = RatingProcessor.CalculateRating(Processor.Accuracy);

            Processor = oldProcessor;

            if (Processor.MultiplayerProcessor != null)
            {
                if (OnlineManager.CurrentGame != null && OnlineManager.CurrentGame.Ruleset != MultiplayerGameRuleset.Battle_Royale &&
                    (Processor.MultiplayerProcessor.IsRegeneratingHealth || Processor.MultiplayerProcessor.IsEliminated))
                {
                    rating = 0;
                }
            }

            return(rating);
        }