Simplify scoreprocesor/healthprocessor implementations

This commit is contained in:
smoogipoo
2019-12-24 17:01:17 +09:00
parent 7414a6aadd
commit 90cb9d9162
17 changed files with 29 additions and 228 deletions

View File

@ -7,7 +7,6 @@ using System.Diagnostics;
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
@ -64,15 +63,9 @@ namespace osu.Game.Rulesets.Scoring
private double scoreMultiplier = 1;
public ScoreProcessor(IBeatmap beatmap)
: base(beatmap)
public ScoreProcessor()
{
Debug.Assert(base_portion + combo_portion == 1.0);
}
protected override void ApplyBeatmap(IBeatmap beatmap)
{
base.ApplyBeatmap(beatmap);
Combo.ValueChanged += combo => HighestCombo.Value = Math.Max(HighestCombo.Value, combo.NewValue);
Accuracy.ValueChanged += accuracy =>
@ -82,12 +75,6 @@ namespace osu.Game.Rulesets.Scoring
Rank.Value = mod.AdjustRank(Rank.Value, accuracy.NewValue);
};
if (maxBaseScore == 0 || maxHighestCombo == 0)
{
Mode.Value = ScoringMode.Classic;
Mode.Disabled = true;
}
Mode.ValueChanged += _ => updateScore();
Mods.ValueChanged += mods =>
{
@ -225,6 +212,12 @@ namespace osu.Game.Rulesets.Scoring
{
maxHighestCombo = HighestCombo.Value;
maxBaseScore = baseScore;
if (maxBaseScore == 0 || maxHighestCombo == 0)
{
Mode.Value = ScoringMode.Classic;
Mode.Disabled = true;
}
}
baseScore = 0;