2018-01-05 20:21:19 +09:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-12-06 00:38:12 +09:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
using osu.Game.IO.Serialization;
|
2017-12-21 13:59:03 +09:00
|
|
|
|
using osu.Game.Storyboards;
|
2017-12-06 00:38:12 +09:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.Formats
|
|
|
|
|
{
|
2017-12-21 14:19:25 +09:00
|
|
|
|
public class JsonBeatmapDecoder : Decoder
|
2017-12-06 00:38:12 +09:00
|
|
|
|
{
|
|
|
|
|
public static void Register()
|
|
|
|
|
{
|
2017-12-21 15:34:00 +09:00
|
|
|
|
AddDecoder("{", m => new JsonBeatmapDecoder());
|
2017-12-06 00:38:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 13:59:03 +09:00
|
|
|
|
public override Decoder GetStoryboardDecoder() => this;
|
|
|
|
|
|
|
|
|
|
protected override void ParseBeatmap(StreamReader stream, Beatmap beatmap)
|
2017-12-06 00:38:12 +09:00
|
|
|
|
{
|
|
|
|
|
stream.BaseStream.Position = 0;
|
|
|
|
|
stream.DiscardBufferedData();
|
|
|
|
|
|
2017-12-21 13:59:03 +09:00
|
|
|
|
stream.ReadToEnd().DeserializeInto(beatmap);
|
2017-12-06 16:28:34 +09:00
|
|
|
|
|
|
|
|
|
foreach (var hitObject in beatmap.HitObjects)
|
|
|
|
|
hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty);
|
2017-12-06 00:38:12 +09:00
|
|
|
|
}
|
2017-12-21 13:59:03 +09:00
|
|
|
|
|
|
|
|
|
protected override void ParseStoryboard(StreamReader stream, Storyboard storyboard)
|
|
|
|
|
{
|
|
|
|
|
// throw new System.NotImplementedException();
|
|
|
|
|
}
|
2017-12-06 00:38:12 +09:00
|
|
|
|
}
|
|
|
|
|
}
|