mirror of
https://github.com/ppy/osu.git
synced 2026-06-09 17:24:04 +08:00
Use ctor rather than MemberwiseClone to guarantee a safer clone of BeatmapDifficulty
This commit is contained in:
@@ -208,6 +208,8 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
||||
|
||||
#region Overrides of BeatmapDifficulty
|
||||
|
||||
public override BeatmapDifficulty Clone() => new TaikoMultiplierAppliedDifficulty(this);
|
||||
|
||||
public override void CopyTo(BeatmapDifficulty other)
|
||||
{
|
||||
base.CopyTo(other);
|
||||
|
||||
@@ -37,12 +37,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
|
||||
/// </summary>
|
||||
public BeatmapDifficulty Clone()
|
||||
{
|
||||
var diff = (BeatmapDifficulty)MemberwiseClone();
|
||||
CopyTo(diff);
|
||||
return diff;
|
||||
}
|
||||
public virtual BeatmapDifficulty Clone() => new BeatmapDifficulty(this);
|
||||
|
||||
public virtual void CopyTo(BeatmapDifficulty difficulty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user