mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 10:52:55 +08:00
AppVeyor
This commit is contained in:
parent
dcc4e863ab
commit
0158246ba1
osu.Game/Beatmaps/Formats
@ -86,7 +86,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleGeneral(string line)
|
private void handleGeneral(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, ':');
|
var pair = SplitKeyVal(line, ':');
|
||||||
|
|
||||||
var metadata = beatmap.BeatmapInfo.Metadata;
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
||||||
switch (pair.Key)
|
switch (pair.Key)
|
||||||
@ -145,7 +145,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleEditor(string line)
|
private void handleEditor(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, ':');
|
var pair = SplitKeyVal(line, ':');
|
||||||
|
|
||||||
switch (pair.Key)
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
@ -169,7 +169,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleMetadata(string line)
|
private void handleMetadata(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, ':');
|
var pair = SplitKeyVal(line, ':');
|
||||||
|
|
||||||
var metadata = beatmap.BeatmapInfo.Metadata;
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
||||||
switch (pair.Key)
|
switch (pair.Key)
|
||||||
@ -210,7 +210,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleDifficulty(string line)
|
private void handleDifficulty(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, ':');
|
var pair = SplitKeyVal(line, ':');
|
||||||
|
|
||||||
var difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
var difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
||||||
switch (pair.Key)
|
switch (pair.Key)
|
||||||
@ -353,7 +353,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleColours(string line)
|
private void handleColours(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, ':');
|
var pair = SplitKeyVal(line, ':');
|
||||||
|
|
||||||
string[] split = pair.Value.Split(',');
|
string[] split = pair.Value.Split(',');
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
protected abstract void ProcessSection(Section section, string line);
|
protected abstract void ProcessSection(Section section, string line);
|
||||||
|
|
||||||
protected KeyValuePair<string, string> splitKeyVal(string line, char separator)
|
protected KeyValuePair<string, string> SplitKeyVal(string line, char separator)
|
||||||
{
|
{
|
||||||
var split = line.Trim().Split(new[] { separator }, 2);
|
var split = line.Trim().Split(new[] { separator }, 2);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
private StoryboardSprite storyboardSprite;
|
private StoryboardSprite storyboardSprite;
|
||||||
private CommandTimelineGroup timelineGroup;
|
private CommandTimelineGroup timelineGroup;
|
||||||
|
|
||||||
private readonly Dictionary<string, string> Variables = new Dictionary<string, string>();
|
private readonly Dictionary<string, string> variables = new Dictionary<string, string>();
|
||||||
|
|
||||||
public LegacyStoryboardDecoder()
|
public LegacyStoryboardDecoder()
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
line = line.Substring(1);
|
line = line.Substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
DecodeVariables(ref line);
|
decodeVariables(ref line);
|
||||||
|
|
||||||
string[] split = line.Split(',');
|
string[] split = line.Split(',');
|
||||||
|
|
||||||
@ -274,15 +274,15 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleVariables(string line)
|
private void handleVariables(string line)
|
||||||
{
|
{
|
||||||
var pair = splitKeyVal(line, '=');
|
var pair = SplitKeyVal(line, '=');
|
||||||
Variables[pair.Key] = pair.Value;
|
variables[pair.Key] = pair.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decodes any beatmap variables present in a line into their real values.
|
/// Decodes any beatmap variables present in a line into their real values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="line">The line which may contains variables.</param>
|
/// <param name="line">The line which may contains variables.</param>
|
||||||
private void DecodeVariables(ref string line)
|
private void decodeVariables(ref string line)
|
||||||
{
|
{
|
||||||
while (line.IndexOf('$') >= 0)
|
while (line.IndexOf('$') >= 0)
|
||||||
{
|
{
|
||||||
@ -291,8 +291,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
for (int i = 0; i < split.Length; i++)
|
for (int i = 0; i < split.Length; i++)
|
||||||
{
|
{
|
||||||
var item = split[i];
|
var item = split[i];
|
||||||
if (item.StartsWith("$") && Variables.ContainsKey(item))
|
if (item.StartsWith("$") && variables.ContainsKey(item))
|
||||||
split[i] = Variables[item];
|
split[i] = variables[item];
|
||||||
}
|
}
|
||||||
|
|
||||||
line = string.Join(",", split);
|
line = string.Join(",", split);
|
||||||
|
Loading…
Reference in New Issue
Block a user