move variables to StoryboardDecoder

This commit is contained in:
james58899
2018-01-04 19:04:52 +08:00
parent 6e8e82e264
commit dcc4e863ab
3 changed files with 42 additions and 43 deletions

View File

@ -8,7 +8,6 @@ using OpenTK.Graphics;
using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Beatmaps.ControlPoints;
using System.Collections.Generic;
namespace osu.Game.Beatmaps.Formats
{
@ -82,9 +81,6 @@ namespace osu.Game.Beatmaps.Formats
case Section.HitObjects:
handleHitObjects(line);
break;
case Section.Variables:
handleVariables(line);
break;
}
}
@ -242,8 +238,6 @@ namespace osu.Game.Beatmaps.Formats
private void handleEvents(string line)
{
DecodeVariables(ref line);
string[] split = line.Split(',');
EventType type;
@ -400,22 +394,5 @@ namespace osu.Game.Beatmaps.Formats
if (obj != null)
beatmap.HitObjects.Add(obj);
}
private void handleVariables(string line)
{
var pair = splitKeyVal(line, '=');
Variables[pair.Key] = pair.Value;
}
private KeyValuePair<string, string> splitKeyVal(string line, char separator)
{
var split = line.Trim().Split(new[] { separator }, 2);
return new KeyValuePair<string, string>
(
split[0].Trim(),
split.Length > 1 ? split[1].Trim() : string.Empty
);
}
}
}