Add IDeepCloneable interface and update existing CreateCopy methods to use it

This commit is contained in:
Dean Herbert
2021-07-19 12:38:22 +09:00
parent 48b34457e7
commit 3c028ce05c
16 changed files with 45 additions and 25 deletions

View File

@ -3,11 +3,12 @@
using System;
using osu.Game.Graphics;
using osu.Game.Utils;
using osuTK.Graphics;
namespace osu.Game.Beatmaps.ControlPoints
{
public abstract class ControlPoint : IComparable<ControlPoint>
public abstract class ControlPoint : IComparable<ControlPoint>, IDeepCloneable<ControlPoint>
{
/// <summary>
/// The time at which the control point takes effect.
@ -32,7 +33,7 @@ namespace osu.Game.Beatmaps.ControlPoints
/// <summary>
/// Create an unbound copy of this control point.
/// </summary>
public ControlPoint CreateCopy()
public ControlPoint DeepClone()
{
var copy = (ControlPoint)Activator.CreateInstance(GetType());