Skip to content

Commit 800132a

Browse files
committed
Updated C# TypeCodes to match the C++ library.
1 parent f0e8dd0 commit 800132a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

RhythmGameUtilities/Enums/TypeCode.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public static class TypeCode
77
/// <summary>
88
/// BPM Marker
99
/// </summary>
10-
public const string BPM = "B";
10+
public const string BPM_Marker = "B";
1111

1212
/// <summary>
1313
/// Time Signature Marker
1414
/// </summary>
15-
public const string TimeSignature = "TS";
15+
public const string TimeSignatureMarker = "TS";
1616

1717
/// <summary>
1818
/// Note Marker
1919
/// </summary>
20-
public const string Note = "N";
20+
public const string NoteMarker = "N";
2121

2222
/// <summary>
2323
/// Event Marker
2424
/// </summary>
25-
public const string Event = "E";
25+
public const string EventMarker = "E";
2626

2727
}
2828

RhythmGameUtilities/Scripts/Parsers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static Dictionary<int, int[]> ParseTimeSignaturesFromChartSection(
113113
KeyValuePair<string, string[]>[] section)
114114
{
115115
return section
116-
.Where(item => item.Value[0] == TypeCode.TimeSignature)
116+
.Where(item => item.Value[0] == TypeCode.TimeSignatureMarker)
117117
.Select(item =>
118118
new KeyValuePair<int, int[]>(int.Parse(item.Key), item.Value.Skip(1).Select(int.Parse).ToArray()))
119119
.ToDictionary(item => item.Key, x => x.Value);
@@ -123,7 +123,7 @@ public static Dictionary<int, int> ParseBpmFromChartSection(
123123
KeyValuePair<string, string[]>[] section)
124124
{
125125
return section
126-
.Where(item => item.Value[0] == TypeCode.BPM)
126+
.Where(item => item.Value[0] == TypeCode.BPM_Marker)
127127
.Select(item => new KeyValuePair<int, int>(int.Parse(item.Key), int.Parse(item.Value.Skip(1).First())))
128128
.OrderBy(item => item.Key)
129129
.ToDictionary(item => item.Key, x => x.Value);
@@ -132,7 +132,7 @@ public static Dictionary<int, int> ParseBpmFromChartSection(
132132
public static Note[] ParseNotesFromChartSection(KeyValuePair<string, string[]>[] section)
133133
{
134134
return section
135-
.Where(item => item.Value.Length == 3 && item.Value.First() == TypeCode.Note).Select(
135+
.Where(item => item.Value.Length == 3 && item.Value.First() == TypeCode.NoteMarker).Select(
136136
item => new Note
137137
{
138138
Position = int.Parse(item.Key),
@@ -145,7 +145,7 @@ public static Dictionary<int, string> ParseLyricsFromChartSection(
145145
KeyValuePair<string, string[]>[] section)
146146
{
147147
return section
148-
.Where(item => item.Value.First() == TypeCode.Event)
148+
.Where(item => item.Value.First() == TypeCode.EventMarker)
149149
.Select(
150150
item => new KeyValuePair<int, string>(int.Parse(item.Key),
151151
JSON_VALUE_PATTERN.Matches(item.Value.Skip(1).First()).Select(part => part.Value.Trim('"'))

UnityPackage/Enums/TypeCode.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public static class TypeCode
77
/// <summary>
88
/// BPM Marker
99
/// </summary>
10-
public const string BPM = "B";
10+
public const string BPM_Marker = "B";
1111

1212
/// <summary>
1313
/// Time Signature Marker
1414
/// </summary>
15-
public const string TimeSignature = "TS";
15+
public const string TimeSignatureMarker = "TS";
1616

1717
/// <summary>
1818
/// Note Marker
1919
/// </summary>
20-
public const string Note = "N";
20+
public const string NoteMarker = "N";
2121

2222
/// <summary>
2323
/// Event Marker
2424
/// </summary>
25-
public const string Event = "E";
25+
public const string EventMarker = "E";
2626

2727
}
2828

UnityPackage/Scripts/Parsers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static Dictionary<int, int[]> ParseTimeSignaturesFromChartSection(
113113
KeyValuePair<string, string[]>[] section)
114114
{
115115
return section
116-
.Where(item => item.Value[0] == TypeCode.TimeSignature)
116+
.Where(item => item.Value[0] == TypeCode.TimeSignatureMarker)
117117
.Select(item =>
118118
new KeyValuePair<int, int[]>(int.Parse(item.Key), item.Value.Skip(1).Select(int.Parse).ToArray()))
119119
.ToDictionary(item => item.Key, x => x.Value);
@@ -123,7 +123,7 @@ public static Dictionary<int, int> ParseBpmFromChartSection(
123123
KeyValuePair<string, string[]>[] section)
124124
{
125125
return section
126-
.Where(item => item.Value[0] == TypeCode.BPM)
126+
.Where(item => item.Value[0] == TypeCode.BPM_Marker)
127127
.Select(item => new KeyValuePair<int, int>(int.Parse(item.Key), int.Parse(item.Value.Skip(1).First())))
128128
.OrderBy(item => item.Key)
129129
.ToDictionary(item => item.Key, x => x.Value);
@@ -132,7 +132,7 @@ public static Dictionary<int, int> ParseBpmFromChartSection(
132132
public static Note[] ParseNotesFromChartSection(KeyValuePair<string, string[]>[] section)
133133
{
134134
return section
135-
.Where(item => item.Value.Length == 3 && item.Value.First() == TypeCode.Note).Select(
135+
.Where(item => item.Value.Length == 3 && item.Value.First() == TypeCode.NoteMarker).Select(
136136
item => new Note
137137
{
138138
Position = int.Parse(item.Key),
@@ -145,7 +145,7 @@ public static Dictionary<int, string> ParseLyricsFromChartSection(
145145
KeyValuePair<string, string[]>[] section)
146146
{
147147
return section
148-
.Where(item => item.Value.First() == TypeCode.Event)
148+
.Where(item => item.Value.First() == TypeCode.EventMarker)
149149
.Select(
150150
item => new KeyValuePair<int, string>(int.Parse(item.Key),
151151
JSON_VALUE_PATTERN.Matches(item.Value.Skip(1).First()).Select(part => part.Value.Trim('"'))

0 commit comments

Comments
 (0)