mirror of
https://github.com/ppy/osu
synced 2025-01-12 00:59:35 +00:00
Always generate mappings/convert values as soon as objects are converted
# Conflicts: # osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs
This commit is contained in:
parent
8d0e7abdd6
commit
024d2abfe0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user