mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:17:23 +08:00
Use ctor
rather than MemberwiseClone
to guarantee a safer clone of BeatmapDifficulty
This commit is contained in:
parent
86b2ac3217
commit
b77cb344d5
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user