mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Add OsuJsonDecoder
This commit is contained in:
25
osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs
Normal file
25
osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs
Normal file
@ -0,0 +1,25 @@
|
||||
// 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;
|
||||
|
||||
namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
public class OsuJsonDecoder : BeatmapDecoder
|
||||
{
|
||||
public static void Register()
|
||||
{
|
||||
AddDecoder<OsuJsonDecoder>("{");
|
||||
}
|
||||
|
||||
protected override void ParseFile(StreamReader stream, Beatmap beatmap)
|
||||
{
|
||||
stream.BaseStream.Position = 0;
|
||||
stream.DiscardBufferedData();
|
||||
|
||||
string fullText = stream.ReadToEnd();
|
||||
fullText.DeserializeInto(beatmap);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user