Make Beatmap ISerializable and add more JsonIgnores

This commit is contained in:
smoogipoo
2017-12-06 00:37:37 +09:00
parent 58777a9674
commit b584178e85
14 changed files with 322 additions and 15 deletions

View File

@ -9,19 +9,21 @@ using System.Linq;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.IO.Serialization;
using osu.Game.Storyboards;
using Newtonsoft.Json;
using osu.Game.IO.Serialization.Converters;
namespace osu.Game.Beatmaps
{
/// <summary>
/// A Beatmap containing converted HitObjects.
/// </summary>
public class Beatmap<T>
public class Beatmap<T> : IJsonSerializable
where T : HitObject
{
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
public ControlPointInfo ControlPointInfo = new ControlPointInfo();
public List<BreakPeriod> Breaks = new List<BreakPeriod>();
public readonly List<Color4> ComboColors = new List<Color4>
public List<Color4> ComboColors = new List<Color4>
{
new Color4(17, 136, 170, 255),
new Color4(102, 136, 0, 255),
@ -29,8 +31,10 @@ namespace osu.Game.Beatmaps
new Color4(121, 9, 13, 255)
};
[JsonIgnore]
public BeatmapMetadata Metadata => BeatmapInfo?.Metadata ?? BeatmapInfo?.BeatmapSet?.Metadata;
[JsonConverter(typeof(TypedListConverter<HitObject>))]
/// <summary>
/// The HitObjects this Beatmap contains.
/// </summary>