mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:03:08 +08:00
Fix cloning
This commit is contained in:
parent
ac64f9d958
commit
e666a82e1f
@ -90,19 +90,19 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
IEnumerable<HitObject> IBeatmap.HitObjects => HitObjects;
|
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();
|
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 class Beatmap : Beatmap<HitObject>
|
||||||
{
|
{
|
||||||
public new Beatmap Clone() => (Beatmap)base.Clone();
|
public Beatmap Clone() => (Beatmap)base.Clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user