1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 21:17:18 +08:00
osu-lazer/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
770 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 18:19:50 +09:00
2022-06-17 16:37:17 +09:00
#nullable disable
using osu.Game.IO;
2017-12-06 00:38:12 +09:00
using osu.Game.IO.Serialization;
2018-04-13 18:19:50 +09:00
2017-12-06 00:38:12 +09:00
namespace osu.Game.Beatmaps.Formats
{
2018-03-09 21:23:03 +09:00
public class JsonBeatmapDecoder : Decoder<Beatmap>
2017-12-06 00:38:12 +09:00
{
public static void Register()
{
2022-06-24 21:25:23 +09:00
AddDecoder<Beatmap>("{", _ => new JsonBeatmapDecoder());
2017-12-06 00:38:12 +09:00
}
2018-04-13 18:19:50 +09:00
protected override void ParseStreamInto(LineBufferedReader stream, Beatmap output)
2017-12-06 00:38:12 +09:00
{
stream.ReadToEnd().DeserializeInto(output);
2018-04-13 18:19:50 +09:00
foreach (var hitObject in output.HitObjects)
hitObject.ApplyDefaults(output.ControlPointInfo, output.Difficulty);
2017-12-06 00:38:12 +09:00
}
}
}