1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:13:21 +08:00

Fix beatmap ruleset not being set

This commit is contained in:
smoogipoo 2019-02-15 14:42:42 +09:00
parent 8becd7ff92
commit 280081d589
2 changed files with 10 additions and 1 deletions

View File

@ -28,5 +28,7 @@ namespace osu.Game.Rulesets.Osu.Tests
});
protected override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new OsuDifficultyCalculator(new OsuRuleset(), beatmap);
protected override Ruleset CreateRuleset() => new OsuRuleset();
}
}

View File

@ -7,6 +7,7 @@ using System.Reflection;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
@ -29,7 +30,11 @@ namespace osu.Game.Tests.Beatmaps
{
var decoder = Decoder.GetDecoder<Beatmap>(stream);
((LegacyBeatmapDecoder)decoder).ApplyOffsets = false;
return new TestWorkingBeatmap(decoder.Decode(stream));
var working = new TestWorkingBeatmap(decoder.Decode(stream));
working.BeatmapInfo.Ruleset = CreateRuleset().RulesetInfo;
return working;
}
}
@ -40,5 +45,7 @@ namespace osu.Game.Tests.Beatmaps
}
protected abstract DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap);
protected abstract Ruleset CreateRuleset();
}
}