Fix up performance calculators

This commit is contained in:
smoogipoo
2018-06-14 16:04:48 +09:00
parent 540b43313e
commit 8f7334874c
11 changed files with 26 additions and 25 deletions

View File

@ -13,8 +13,7 @@ namespace osu.Game.Rulesets.Difficulty
{
public abstract class PerformanceCalculator
{
private readonly Dictionary<string, double> attributes = new Dictionary<string, double>();
protected IDictionary<string, double> Attributes => attributes;
protected readonly DifficultyAttributes Attributes;
protected readonly Ruleset Ruleset;
protected readonly IBeatmap Beatmap;
@ -22,14 +21,15 @@ namespace osu.Game.Rulesets.Difficulty
protected double TimeRate { get; private set; } = 1;
protected PerformanceCalculator(Ruleset ruleset, IBeatmap beatmap, Score score)
protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, Score score)
{
Ruleset = ruleset;
Beatmap = beatmap;
Score = score;
var diffCalc = ruleset.CreateDifficultyCalculator(beatmap, score.Mods);
diffCalc.Calculate(attributes);
beatmap.Mods.Value = score.Mods;
Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo);
Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(score.Mods);
ApplyMods(score.Mods);
}