mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Remove return type from AddDifficultyToBeatmapSet
Also removes a pointless realm encapsulation.
This commit is contained in:
@ -128,10 +128,10 @@ namespace osu.Game.Beatmaps
|
|||||||
foreach (var timingPoint in referenceBeatmap.Beatmap.ControlPointInfo.TimingPoints)
|
foreach (var timingPoint in referenceBeatmap.Beatmap.ControlPointInfo.TimingPoints)
|
||||||
newBeatmap.ControlPointInfo.Add(timingPoint.Time, timingPoint.DeepClone());
|
newBeatmap.ControlPointInfo.Add(timingPoint.Time, timingPoint.DeepClone());
|
||||||
|
|
||||||
var createdBeatmapInfo = beatmapModelManager.AddDifficultyToBeatmapSet(beatmapSetInfo, newBeatmap);
|
beatmapModelManager.AddDifficultyToBeatmapSet(beatmapSetInfo, newBeatmap);
|
||||||
|
|
||||||
workingBeatmapCache.Invalidate(createdBeatmapInfo.BeatmapSet);
|
workingBeatmapCache.Invalidate(beatmapSetInfo);
|
||||||
return GetWorkingBeatmap(createdBeatmapInfo);
|
return GetWorkingBeatmap(newBeatmap.BeatmapInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add back support for making a copy of another difficulty
|
// TODO: add back support for making a copy of another difficulty
|
||||||
|
@ -93,19 +93,14 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a new difficulty to the beatmap set represented by the provided <see cref="BeatmapSetInfo"/>.
|
/// Add a new difficulty to the beatmap set represented by the provided <see cref="BeatmapSetInfo"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BeatmapInfo AddDifficultyToBeatmapSet(BeatmapSetInfo beatmapSetInfo, Beatmap beatmap)
|
public void AddDifficultyToBeatmapSet(BeatmapSetInfo beatmapSetInfo, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
return Realm.Run(realm =>
|
var beatmapInfo = beatmap.BeatmapInfo;
|
||||||
{
|
|
||||||
var beatmapInfo = beatmap.BeatmapInfo;
|
|
||||||
|
|
||||||
beatmapSetInfo.Beatmaps.Add(beatmapInfo);
|
beatmapSetInfo.Beatmaps.Add(beatmapInfo);
|
||||||
beatmapInfo.BeatmapSet = beatmapSetInfo;
|
beatmapInfo.BeatmapSet = beatmapSetInfo;
|
||||||
|
|
||||||
Save(beatmapInfo, beatmap);
|
Save(beatmapInfo, beatmap);
|
||||||
|
|
||||||
return beatmapInfo.Detach();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string getFilename(BeatmapInfo beatmapInfo)
|
private static string getFilename(BeatmapInfo beatmapInfo)
|
||||||
|
Reference in New Issue
Block a user