1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-25 16:52:55 +08:00
osu-lazer/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs

36 lines
1.1 KiB
C#
Raw Normal View History

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