1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Remove construction of new ruleset

This commit is contained in:
smoogipoo 2018-05-16 01:43:58 +09:00
parent ed902d9325
commit de63a1b578
2 changed files with 4 additions and 3 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
if (mods.Any(m => !m.Ranked))
return 0;
IEnumerable<Mod> scoreIncreaseMods = new ManiaRuleset().GetModsFor(ModType.DifficultyIncrease);
IEnumerable<Mod> scoreIncreaseMods = Ruleset.GetModsFor(ModType.DifficultyIncrease);
double scoreMultiplier = 1.0;
foreach (var m in mods.Where(m => !scoreIncreaseMods.Contains(m)))

View File

@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Difficulty
private readonly Dictionary<string, double> attributes = new Dictionary<string, double>();
protected IDictionary<string, double> Attributes => attributes;
protected readonly Ruleset Ruleset;
protected readonly IBeatmap Beatmap;
protected readonly Score Score;
@ -23,9 +24,9 @@ namespace osu.Game.Rulesets.Difficulty
protected PerformanceCalculator(Ruleset ruleset, IBeatmap beatmap, Score score)
{
Score = score;
Ruleset = ruleset;
Beatmap = beatmap;
Score = score;
var diffCalc = ruleset.CreateDifficultyCalculator(beatmap, score.Mods);
diffCalc.Calculate(attributes);