1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Use BindableListConverter to deserialize control points

This commit is contained in:
tsunyoku 2023-10-15 13:27:07 +01:00
parent 5ef4ac3f7a
commit 6c8f4addb8
2 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,9 @@
using System;
using System.Linq;
using Newtonsoft.Json;
using osu.Framework.Bindables;
using osu.Game.IO.Serialization.Converters;
namespace osu.Game.Beatmaps.ControlPoints
{
@ -17,8 +19,11 @@ namespace osu.Game.Beatmaps.ControlPoints
/// </summary>
public double Time { get; }
[JsonIgnore]
public IBindableList<ControlPoint> ControlPoints => controlPoints;
[JsonConverter(typeof(BindableListConverter<ControlPoint>))]
[JsonProperty]
private readonly BindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
public ControlPointGroup(double time)

View File

@ -22,9 +22,10 @@ namespace osu.Game.Beatmaps.ControlPoints
/// <summary>
/// All control points grouped by time.
/// </summary>
[JsonProperty]
[JsonIgnore]
public IBindableList<ControlPointGroup> Groups => groups;
[JsonProperty]
private readonly BindableList<ControlPointGroup> groups = new BindableList<ControlPointGroup>();
/// <summary>