2016-12-06 17:56:20 +08:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-10-08 03:09:52 +08:00
|
|
|
|
using System.Collections.Generic;
|
2016-10-13 01:26:09 +08:00
|
|
|
|
using System.Globalization;
|
2016-10-05 04:29:08 +08:00
|
|
|
|
using System.IO;
|
2016-10-11 01:00:16 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2016-10-19 01:35:01 +08:00
|
|
|
|
using osu.Game.Database;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
using osu.Game.Beatmaps.Events;
|
2016-10-08 04:19:24 +08:00
|
|
|
|
using osu.Game.Beatmaps.Samples;
|
2016-10-08 03:09:52 +08:00
|
|
|
|
using osu.Game.Beatmaps.Timing;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes;
|
|
|
|
|
using osu.Game.Modes.Objects;
|
2016-11-14 16:23:33 +08:00
|
|
|
|
using osu.Game.Screens.Play;
|
2016-10-05 04:29:08 +08:00
|
|
|
|
|
2016-10-08 03:36:20 +08:00
|
|
|
|
namespace osu.Game.Beatmaps.Formats
|
|
|
|
|
{
|
|
|
|
|
public class OsuLegacyDecoder : BeatmapDecoder
|
|
|
|
|
{
|
|
|
|
|
public static void Register()
|
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v14");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v13");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v12");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v11");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v10");
|
2016-10-14 01:49:44 +08:00
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v9");
|
2016-12-21 16:29:57 +08:00
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v8");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v7");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v6");
|
|
|
|
|
AddDecoder<OsuLegacyDecoder>(@"osu file format v5");
|
2016-10-08 03:36:20 +08:00
|
|
|
|
// TODO: Not sure how far back to go, or differences between versions
|
2016-10-05 04:29:08 +08:00
|
|
|
|
}
|
2016-10-08 03:36:20 +08:00
|
|
|
|
|
|
|
|
|
private enum Section
|
|
|
|
|
{
|
|
|
|
|
None,
|
|
|
|
|
General,
|
|
|
|
|
Editor,
|
|
|
|
|
Metadata,
|
|
|
|
|
Difficulty,
|
|
|
|
|
Events,
|
|
|
|
|
TimingPoints,
|
|
|
|
|
Colours,
|
|
|
|
|
HitObjects,
|
2016-10-05 04:29:08 +08:00
|
|
|
|
}
|
2016-10-08 03:36:20 +08:00
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleGeneral(Beatmap beatmap, string key, string val)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
2016-10-19 01:35:01 +08:00
|
|
|
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
switch (key)
|
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"AudioFilename":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.AudioFile = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"AudioLeadIn":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.AudioLeadIn = int.Parse(val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"PreviewTime":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.PreviewTime = int.Parse(val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Countdown":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Countdown = int.Parse(val) == 1;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"SampleSet":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.SampleSet = (SampleSet)Enum.Parse(typeof(SampleSet), val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"StackLeniency":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Mode":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Mode = (PlayMode)int.Parse(val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"LetterboxInBreaks":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"SpecialStyle":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.SpecialStyle = int.Parse(val) == 1;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"WidescreenStoryboard":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(val) == 1;
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleEditor(Beatmap beatmap, string key, string val)
|
2016-10-08 04:19:24 +08:00
|
|
|
|
{
|
|
|
|
|
switch (key)
|
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Bookmarks":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.StoredBookmarks = val;
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"DistanceSpacing":
|
2016-11-28 21:48:28 +08:00
|
|
|
|
beatmap.BeatmapInfo.DistanceSpacing = double.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"BeatDivisor":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.BeatDivisor = int.Parse(val);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"GridSize":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.GridSize = int.Parse(val);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"TimelineZoom":
|
2016-11-28 21:48:28 +08:00
|
|
|
|
beatmap.BeatmapInfo.TimelineZoom = double.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleMetadata(Beatmap beatmap, string key, string val)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
2016-10-19 01:35:01 +08:00
|
|
|
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
switch (key)
|
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Title":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.Title = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"TitleUnicode":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.TitleUnicode = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Artist":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.Artist = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"ArtistUnicode":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.ArtistUnicode = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Creator":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
metadata.Author = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Version":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Version = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Source":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Metadata.Source = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"Tags":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Metadata.Tags = val;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"BeatmapID":
|
2017-01-09 21:05:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"BeatmapSetID":
|
2017-01-09 21:05:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(val);
|
|
|
|
|
metadata.OnlineBeatmapSetID = int.Parse(val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleDifficulty(Beatmap beatmap, string key, string val)
|
2016-10-08 04:19:24 +08:00
|
|
|
|
{
|
2016-10-19 01:35:01 +08:00
|
|
|
|
var difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
2016-10-08 04:19:24 +08:00
|
|
|
|
switch (key)
|
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"HPDrainRate":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.DrainRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"CircleSize":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.CircleSize = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"OverallDifficulty":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.OverallDifficulty = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"ApproachRate":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.ApproachRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"SliderMultiplier":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.SliderMultiplier = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
case @"SliderTickRate":
|
2016-10-19 01:35:01 +08:00
|
|
|
|
difficulty.SliderTickRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleEvents(Beatmap beatmap, string val)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
2016-10-13 01:36:10 +08:00
|
|
|
|
if (val.StartsWith(@"//"))
|
2016-10-08 03:36:20 +08:00
|
|
|
|
return;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
if (val.StartsWith(@" "))
|
2016-10-13 01:26:09 +08:00
|
|
|
|
return; // TODO
|
2016-10-08 03:36:20 +08:00
|
|
|
|
string[] split = val.Split(',');
|
|
|
|
|
EventType type;
|
|
|
|
|
int _type;
|
|
|
|
|
if (!int.TryParse(split[0], out _type))
|
|
|
|
|
{
|
|
|
|
|
if (!Enum.TryParse(split[0], out type))
|
|
|
|
|
throw new InvalidDataException($@"Unknown event type {split[0]}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
type = (EventType)_type;
|
|
|
|
|
// TODO: Parse and store the rest of the event
|
|
|
|
|
if (type == EventType.Background)
|
2016-10-19 01:35:01 +08:00
|
|
|
|
beatmap.BeatmapInfo.Metadata.BackgroundFile = split[2].Trim('"');
|
2016-10-08 03:09:52 +08:00
|
|
|
|
}
|
2016-10-05 04:29:08 +08:00
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleTimingPoints(Beatmap beatmap, string val)
|
2016-10-08 04:19:24 +08:00
|
|
|
|
{
|
2016-11-28 14:12:11 +08:00
|
|
|
|
ControlPoint cp = null;
|
|
|
|
|
|
|
|
|
|
string[] split = val.Split(',');
|
|
|
|
|
|
|
|
|
|
if (split.Length > 2)
|
|
|
|
|
{
|
|
|
|
|
int kiai_flags = split.Length > 7 ? Convert.ToInt32(split[7], NumberFormatInfo.InvariantInfo) : 0;
|
2016-11-28 22:05:05 +08:00
|
|
|
|
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
|
2016-11-28 14:12:11 +08:00
|
|
|
|
cp = new ControlPoint
|
|
|
|
|
{
|
2016-11-28 22:05:05 +08:00
|
|
|
|
Time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo),
|
2016-11-28 14:12:11 +08:00
|
|
|
|
BeatLength = beatLength > 0 ? beatLength : 0,
|
|
|
|
|
VelocityAdjustment = beatLength < 0 ? -beatLength / 100.0 : 1,
|
|
|
|
|
TimingChange = split.Length <= 6 || split[6][0] == '1',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cp != null)
|
|
|
|
|
beatmap.ControlPoints.Add(cp);
|
2016-10-08 04:19:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 01:55:58 +08:00
|
|
|
|
private void handleColours(Beatmap beatmap, string key, string val)
|
2016-10-11 01:00:16 +08:00
|
|
|
|
{
|
|
|
|
|
string[] split = val.Split(',');
|
|
|
|
|
if (split.Length != 3)
|
|
|
|
|
throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}");
|
|
|
|
|
byte r, g, b;
|
|
|
|
|
if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b))
|
|
|
|
|
throw new InvalidOperationException($@"Color must be specified with 8-bit integer components");
|
|
|
|
|
// Note: the combo index specified in the beatmap is discarded
|
|
|
|
|
beatmap.ComboColors.Add(new Color4
|
|
|
|
|
{
|
|
|
|
|
R = r / 255f,
|
|
|
|
|
G = g / 255f,
|
|
|
|
|
B = b / 255f,
|
|
|
|
|
A = 1f,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-02 17:08:08 +08:00
|
|
|
|
protected override Beatmap ParseFile(TextReader stream)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
2016-10-19 01:35:01 +08:00
|
|
|
|
var beatmap = new Beatmap
|
|
|
|
|
{
|
|
|
|
|
HitObjects = new List<HitObject>(),
|
|
|
|
|
ControlPoints = new List<ControlPoint>(),
|
|
|
|
|
ComboColors = new List<Color4>(),
|
2016-10-20 01:13:14 +08:00
|
|
|
|
BeatmapInfo = new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Metadata = new BeatmapMetadata(),
|
|
|
|
|
BaseDifficulty = new BaseDifficulty(),
|
|
|
|
|
},
|
2016-10-19 01:35:01 +08:00
|
|
|
|
};
|
2016-11-14 21:03:39 +08:00
|
|
|
|
|
|
|
|
|
HitObjectParser parser = null;
|
|
|
|
|
|
2016-10-08 03:36:20 +08:00
|
|
|
|
var section = Section.None;
|
|
|
|
|
string line;
|
2016-10-08 03:09:52 +08:00
|
|
|
|
while (true)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
|
|
|
|
line = stream.ReadLine();
|
2016-10-08 03:09:52 +08:00
|
|
|
|
if (line == null)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
if (string.IsNullOrEmpty(line))
|
|
|
|
|
continue;
|
2016-10-13 01:36:10 +08:00
|
|
|
|
if (line.StartsWith(@"osu file format v"))
|
2016-10-10 22:17:18 +08:00
|
|
|
|
continue;
|
2016-11-14 21:03:39 +08:00
|
|
|
|
|
2016-10-13 01:36:10 +08:00
|
|
|
|
if (line.StartsWith(@"[") && line.EndsWith(@"]"))
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
|
|
|
|
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
|
|
|
|
throw new InvalidDataException($@"Unknown osu section {line}");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2016-11-14 21:03:39 +08:00
|
|
|
|
|
2016-10-08 03:36:20 +08:00
|
|
|
|
string val = line, key = null;
|
2016-10-11 01:00:16 +08:00
|
|
|
|
if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects)
|
2016-10-08 03:36:20 +08:00
|
|
|
|
{
|
|
|
|
|
key = val.Remove(val.IndexOf(':')).Trim();
|
2016-10-08 03:09:52 +08:00
|
|
|
|
val = val.Substring(val.IndexOf(':') + 1).Trim();
|
2016-10-08 03:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
switch (section)
|
|
|
|
|
{
|
|
|
|
|
case Section.General:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleGeneral(beatmap, key, val);
|
2016-11-14 21:03:39 +08:00
|
|
|
|
parser = Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).CreateHitObjectParser();
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
case Section.Editor:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleEditor(beatmap, key, val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
case Section.Metadata:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleMetadata(beatmap, key, val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
case Section.Difficulty:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleDifficulty(beatmap, key, val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
case Section.Events:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleEvents(beatmap, val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
case Section.TimingPoints:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleTimingPoints(beatmap, val);
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
2016-10-11 01:00:16 +08:00
|
|
|
|
case Section.Colours:
|
2016-10-11 01:55:58 +08:00
|
|
|
|
handleColours(beatmap, key, val);
|
2016-10-11 01:00:16 +08:00
|
|
|
|
break;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
case Section.HitObjects:
|
2016-11-14 21:03:39 +08:00
|
|
|
|
var obj = parser?.Parse(val);
|
2016-11-28 14:31:54 +08:00
|
|
|
|
|
2016-11-14 21:03:39 +08:00
|
|
|
|
if (obj != null)
|
2016-11-28 14:31:54 +08:00
|
|
|
|
{
|
2016-11-28 17:45:50 +08:00
|
|
|
|
obj.SetDefaultsFromBeatmap(beatmap);
|
2016-11-14 21:03:39 +08:00
|
|
|
|
beatmap.HitObjects.Add(obj);
|
2016-11-28 14:31:54 +08:00
|
|
|
|
}
|
2016-10-08 03:36:20 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-14 21:03:39 +08:00
|
|
|
|
|
2016-10-19 01:35:01 +08:00
|
|
|
|
return beatmap;
|
2016-10-08 03:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-12 01:52:16 +08:00
|
|
|
|
}
|