mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 03:42:56 +08:00
Use BindableListConverter to deserialize control points
This commit is contained in:
parent
5ef4ac3f7a
commit
6c8f4addb8
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Game.IO.Serialization.Converters;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.ControlPoints
|
namespace osu.Game.Beatmaps.ControlPoints
|
||||||
{
|
{
|
||||||
@ -17,8 +19,11 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double Time { get; }
|
public double Time { get; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public IBindableList<ControlPoint> ControlPoints => controlPoints;
|
public IBindableList<ControlPoint> ControlPoints => controlPoints;
|
||||||
|
|
||||||
|
[JsonConverter(typeof(BindableListConverter<ControlPoint>))]
|
||||||
|
[JsonProperty]
|
||||||
private readonly BindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
|
private readonly BindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
|
||||||
|
|
||||||
public ControlPointGroup(double time)
|
public ControlPointGroup(double time)
|
||||||
|
@ -22,9 +22,10 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// All control points grouped by time.
|
/// All control points grouped by time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty]
|
[JsonIgnore]
|
||||||
public IBindableList<ControlPointGroup> Groups => groups;
|
public IBindableList<ControlPointGroup> Groups => groups;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private readonly BindableList<ControlPointGroup> groups = new BindableList<ControlPointGroup>();
|
private readonly BindableList<ControlPointGroup> groups = new BindableList<ControlPointGroup>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user