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

Tidy up ruleset assignment code

This commit is contained in:
Dean Herbert 2020-05-20 10:06:23 +09:00
parent db4e3047dd
commit 9638064741

View File

@ -101,9 +101,6 @@ namespace osu.Game.Tests.Beatmaps
{ {
var beatmap = GetBeatmap(name); var beatmap = GetBeatmap(name);
var rulesetInstance = CreateRuleset();
beatmap.BeatmapInfo.Ruleset = beatmap.BeatmapInfo.RulesetID == rulesetInstance.RulesetInfo.ID ? rulesetInstance.RulesetInfo : new RulesetInfo();
var converterResult = new Dictionary<HitObject, IEnumerable<HitObject>>(); var converterResult = new Dictionary<HitObject, IEnumerable<HitObject>>();
var working = new ConversionWorkingBeatmap(beatmap) var working = new ConversionWorkingBeatmap(beatmap)
@ -115,7 +112,7 @@ namespace osu.Game.Tests.Beatmaps
} }
}; };
working.GetPlayableBeatmap(rulesetInstance.RulesetInfo, mods); working.GetPlayableBeatmap(CreateRuleset().RulesetInfo, mods);
return new ConvertResult return new ConvertResult
{ {
@ -152,8 +149,8 @@ namespace osu.Game.Tests.Beatmaps
((LegacyBeatmapDecoder)decoder).ApplyOffsets = false; ((LegacyBeatmapDecoder)decoder).ApplyOffsets = false;
var beatmap = decoder.Decode(stream); var beatmap = decoder.Decode(stream);
// not sure but seems to be required. var rulesetInstance = CreateRuleset();
beatmap.BeatmapInfo.Ruleset = CreateRuleset().RulesetInfo; beatmap.BeatmapInfo.Ruleset = beatmap.BeatmapInfo.RulesetID == rulesetInstance.RulesetInfo.ID ? rulesetInstance.RulesetInfo : new RulesetInfo();
return beatmap; return beatmap;
} }