mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:43:21 +08:00
Move ControlPointInfo copying to base Beatmap.Clone method (and remove setter)
This commit is contained in:
parent
77b55212a3
commit
3c3e860dbc
@ -50,7 +50,15 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
IBeatmap IBeatmap.Clone() => Clone();
|
IBeatmap IBeatmap.Clone() => Clone();
|
||||||
|
|
||||||
public Beatmap<T> Clone() => (Beatmap<T>)MemberwiseClone();
|
public Beatmap<T> Clone()
|
||||||
|
{
|
||||||
|
var clone = (Beatmap<T>)MemberwiseClone();
|
||||||
|
|
||||||
|
clone.ControlPointInfo = ControlPointInfo.CreateCopy();
|
||||||
|
// todo: deep clone other elements as required.
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Beatmap : Beatmap<HitObject>
|
public class Beatmap : Beatmap<HitObject>
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The control points in this beatmap.
|
/// The control points in this beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ControlPointInfo ControlPointInfo { get; set; }
|
ControlPointInfo ControlPointInfo { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The breaks in this beatmap.
|
/// The breaks in this beatmap.
|
||||||
|
@ -111,8 +111,6 @@ namespace osu.Game.Beatmaps
|
|||||||
// Convert
|
// Convert
|
||||||
IBeatmap converted = converter.Convert(cancellationSource.Token);
|
IBeatmap converted = converter.Convert(cancellationSource.Token);
|
||||||
|
|
||||||
converted.ControlPointInfo = converted.ControlPointInfo.CreateCopy();
|
|
||||||
|
|
||||||
// Apply conversion mods to the result
|
// Apply conversion mods to the result
|
||||||
foreach (var mod in mods.OfType<IApplicableAfterBeatmapConversion>())
|
foreach (var mod in mods.OfType<IApplicableAfterBeatmapConversion>())
|
||||||
{
|
{
|
||||||
|
@ -74,11 +74,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public BeatmapMetadata Metadata => PlayableBeatmap.Metadata;
|
public BeatmapMetadata Metadata => PlayableBeatmap.Metadata;
|
||||||
|
|
||||||
public ControlPointInfo ControlPointInfo
|
public ControlPointInfo ControlPointInfo => PlayableBeatmap.ControlPointInfo;
|
||||||
{
|
|
||||||
get => PlayableBeatmap.ControlPointInfo;
|
|
||||||
set => PlayableBeatmap.ControlPointInfo = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BreakPeriod> Breaks => PlayableBeatmap.Breaks;
|
public List<BreakPeriod> Breaks => PlayableBeatmap.Breaks;
|
||||||
|
|
||||||
|
@ -29,11 +29,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public BeatmapMetadata Metadata => PlayableBeatmap.Metadata;
|
public BeatmapMetadata Metadata => PlayableBeatmap.Metadata;
|
||||||
|
|
||||||
public ControlPointInfo ControlPointInfo
|
public ControlPointInfo ControlPointInfo => PlayableBeatmap.ControlPointInfo;
|
||||||
{
|
|
||||||
get => PlayableBeatmap.ControlPointInfo;
|
|
||||||
set => PlayableBeatmap.ControlPointInfo = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BreakPeriod> Breaks => PlayableBeatmap.Breaks;
|
public List<BreakPeriod> Breaks => PlayableBeatmap.Breaks;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user