Remove IBeatmap from PerformanceCalculator.

This commit is contained in:
Lucas A
2020-10-02 19:24:30 +02:00
parent b1e7a5113e
commit 0163688a17
10 changed files with 16 additions and 19 deletions

View File

@ -1,11 +1,11 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Audio.Track;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
@ -16,19 +16,16 @@ namespace osu.Game.Rulesets.Difficulty
protected readonly DifficultyAttributes Attributes;
protected readonly Ruleset Ruleset;
protected readonly IBeatmap Beatmap;
protected readonly ScoreInfo Score;
protected double TimeRate { get; private set; } = 1;
protected PerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score)
protected PerformanceCalculator(Ruleset ruleset, DifficultyAttributes attributes, ScoreInfo score)
{
Ruleset = ruleset;
Score = score;
Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo, score.Mods);
Attributes = ruleset.CreateDifficultyCalculator(beatmap).Calculate(score.Mods);
Attributes = attributes ?? throw new ArgumentNullException(nameof(attributes));
ApplyMods(score.Mods);
}