1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Fix cloning

This commit is contained in:
smoogipoo 2018-04-19 18:50:21 +09:00
parent ac64f9d958
commit e666a82e1f

View File

@ -90,19 +90,19 @@ namespace osu.Game.Beatmaps
IEnumerable<HitObject> IBeatmap.HitObjects => HitObjects;
public Beatmap<T> Clone() => new Beatmap<T>
{
BeatmapInfo = BeatmapInfo.DeepClone(),
ControlPointInfo = ControlPointInfo,
Breaks = Breaks,
HitObjects = HitObjects
};
IBeatmap IBeatmap.Clone() => Clone();
public Beatmap<T> Clone()
{
var newInstance = (Beatmap<T>)MemberwiseClone();
newInstance.BeatmapInfo = BeatmapInfo.DeepClone();
return newInstance;
}
}
public class Beatmap : Beatmap<HitObject>
{
public new Beatmap Clone() => (Beatmap)base.Clone();
public Beatmap Clone() => (Beatmap)base.Clone();
}
}