Always generate mappings/convert values as soon as objects are converted

# Conflicts:
#	osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs
This commit is contained in:
smoogipoo 2018-06-14 20:26:55 +09:00
parent 8d0e7abdd6
commit 024d2abfe0

View File

@ -86,25 +86,19 @@ namespace osu.Game.Tests.Beatmaps
var result = new ConvertResult();
var converter = rulesetInstance.CreateBeatmapConverter(beatmap);
var conversions = new List<KeyValuePair<HitObject, IEnumerable<HitObject>>>();
converter.ObjectConverted += (orig, converted) =>
{
conversions.Add(new KeyValuePair<HitObject, IEnumerable<HitObject>>(orig, converted));
converted.ForEach(h => h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty));
var mapping = new ConvertMapping { StartTime = orig.StartTime };
foreach (var obj in converted)
mapping.Objects.AddRange(CreateConvertValue(obj));
result.Mappings.Add(mapping);
};
IBeatmap convertedBeatmap = converter.Convert();
rulesetInstance.CreateBeatmapProcessor(convertedBeatmap)?.PostProcess();
foreach (var pair in conversions)
{
var mapping = new ConvertMapping { StartTime = pair.Key.StartTime };
foreach (var obj in pair.Value)
mapping.Objects.AddRange(CreateConvertValue(obj));
result.Mappings.Add(mapping);
}
return result;
}