Clone and copy ControlPointInfo when retrieving a playable beatmap

This commit is contained in:
Dean Herbert
2021-01-04 16:37:07 +09:00
parent cd7a5ca23a
commit ba4e411422
11 changed files with 86 additions and 6 deletions

View File

@ -11,7 +11,7 @@ using osu.Framework.Lists;
namespace osu.Game.Beatmaps.ControlPoints
{
[Serializable]
public class ControlPointInfo
public class ControlPointInfo : ICloneable
{
/// <summary>
/// All control points grouped by time.
@ -297,5 +297,15 @@ namespace osu.Game.Beatmaps.ControlPoints
break;
}
}
public object Clone()
{
var controlPointInfo = new ControlPointInfo();
foreach (var point in AllControlPoints)
controlPointInfo.Add(point.Time, point.CreateCopy());
return controlPointInfo;
}
}
}