Skip to content

Commit 1cc5037

Browse files
committed
[R] ChuNote,重命名Extra为Tag
1 parent d404a68 commit 1cc5037

7 files changed

Lines changed: 13 additions & 13 deletions

File tree

chart/chu/ChuNote.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ChuNote
2424
/** SLD 终点宽度 */
2525
public int EndWidth { get; set; } = 1;
2626
/** CHR/FLK 附加数据(方向等) */
27-
public string Extra { get; set; } = "";
27+
public string Tag { get; set; } = "";
2828
/** AIR/AHD 关联的目标音符类型 */
2929
public string TargetNote { get; set; } = "";
3030
/** AHD 持续时长 */

generator/chu/C2sGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static ChuNote ScaleNote(ChuNote n, int tpb)
6666
Cell = n.Cell, Width = n.Width,
6767
HoldDuration = scaleDown(n.HoldDuration), SlideDuration = scaleDown(n.SlideDuration),
6868
EndCell = n.EndCell, EndWidth = n.EndWidth,
69-
Extra = n.Extra, TargetNote = n.TargetNote, AirHoldDuration = scaleDown(n.AirHoldDuration),
69+
Tag = n.Tag, TargetNote = n.TargetNote, AirHoldDuration = scaleDown(n.AirHoldDuration),
7070
StartHeight = n.StartHeight, TargetHeight = n.TargetHeight, NoteColor = n.NoteColor,
7171
};
7272
}
@@ -109,10 +109,10 @@ private static string Serialize(C2sChart chart)
109109
private static string FormatNote(ChuNote n) => n.Type switch
110110
{
111111
"TAP" => $"TAP\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}",
112-
"CHR" => $"CHR\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.Extra}",
112+
"CHR" => $"CHR\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.Tag}",
113113
"HLD" or "HXD" => $"{n.Type}\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.HoldDuration}",
114114
"SLD" or "SLC" or "SXD" or "SXC" => $"{n.Type}\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.SlideDuration}\t{n.EndCell}\t{n.EndWidth}",
115-
"FLK" => $"FLK\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.Extra}",
115+
"FLK" => $"FLK\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.Tag}",
116116
"AIR" or "AUR" or "AUL" or "ADW" or "ADR" or "ADL" => $"{n.Type}\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.TargetNote}",
117117
"AHD" => $"AHD\t{n.Measure}\t{n.Offset}\t{n.Cell}\t{n.Width}\t{n.TargetNote}\t{n.AirHoldDuration}",
118118
"ALD" or "ASD" => $"{n.Type}\t{n.Measure}\t{n.Offset}\t{n.StartHeight}\t{n.SlideDuration}\t{n.EndCell}\t{n.EndWidth}\t{n.TargetHeight}\t{n.NoteColor}",

generator/chu/SusGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static ChuNote ScaleUp(ChuNote n, int sourceTicksPerBeat)
5959
Cell = n.Cell * 2, Width = n.Width * 2,
6060
HoldDuration = s(n.HoldDuration), SlideDuration = s(n.SlideDuration),
6161
EndCell = n.EndCell * 2, EndWidth = n.EndWidth * 2,
62-
Extra = n.Extra, TargetNote = n.TargetNote, AirHoldDuration = s(n.AirHoldDuration),
62+
Tag = n.Tag, TargetNote = n.TargetNote, AirHoldDuration = s(n.AirHoldDuration),
6363
};
6464
}
6565

generator/chu/UgcGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static ChuNote ScaleUpNote(ChuNote n)
5858
Cell = n.Cell, Width = n.Width,
5959
HoldDuration = s(n.HoldDuration), SlideDuration = s(n.SlideDuration),
6060
EndCell = n.EndCell, EndWidth = n.EndWidth,
61-
Extra = n.Extra, TargetNote = IsAir(n.Type) && string.IsNullOrEmpty(n.TargetNote) ? "N" : n.TargetNote,
61+
Tag = n.Tag, TargetNote = IsAir(n.Type) && string.IsNullOrEmpty(n.TargetNote) ? "N" : n.TargetNote,
6262
AirHoldDuration = s(n.AirHoldDuration),
6363
StartHeight = n.StartHeight, TargetHeight = n.TargetHeight, NoteColor = n.NoteColor,
6464
};
@@ -111,7 +111,7 @@ private static string UCode(ChuNote n)
111111
return n.Type switch
112112
{
113113
"TAP" => $"t{c}{w}",
114-
"CHR" => $"x{c}{w}{n.Extra}",
114+
"CHR" => $"x{c}{w}{n.Tag}",
115115
"HLD" or "HXD" => $"h{c}{w}",
116116
"SLD" or "SXD" => $"s{c}{w}",
117117
"SLC" or "SXC" => $"s{c}{w}",

parser/chu/C2sParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ private static void ParseNote(string[] p, C2sChart chart, List<Alert> alerts, in
9393
case "TAP": case "MNE":
9494
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); break;
9595
case "CHR":
96-
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Extra = Str(p, 5); break;
96+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Tag = Str(p, 5); break;
9797
case "HLD": case "HXD":
9898
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.HoldDuration = Int(p, 5); break;
9999
case "SLD": case "SLC": case "SXD": case "SXC":
100100
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1));
101101
note.SlideDuration = Int(p, 5); note.EndCell = Int(p, 6); note.EndWidth = Math.Max(1, Int(p, 7, 1)); break;
102102
case "FLK":
103-
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Extra = Str(p, 5); break;
103+
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.Tag = Str(p, 5); break;
104104
case "AIR": case "AUR": case "AUL": case "ADW": case "ADR": case "ADL":
105105
note.Cell = Int(p, 3); note.Width = Math.Max(1, Int(p, 4, 1)); note.TargetNote = Str(p, 5); break;
106106
case "AHD":

parser/chu/UgcParser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ private static int ParseNoteLine(string[] lines, int idx, UgcChart chart, List<A
281281
note.Type = "FLK";
282282
ParseCellWidth(code, 1, note, alerts, lineNum);
283283
if (code.Length > 3)
284-
note.Extra = code[3..];
284+
note.Tag = code[3..];
285285
break;
286286

287287
case 'c':
@@ -481,9 +481,9 @@ private static void ParseChrNote(string code, ChuNote note, List<Alert> alerts,
481481
ParseCellWidth(code, 1, note, alerts, lineNum);
482482
var extraRaw = code.Length > 3 ? code[3..] : "";
483483
if (ChrExtras.TryGetValue(extraRaw, out var chrDir))
484-
note.Extra = chrDir;
484+
note.Tag = chrDir;
485485
else
486-
note.Extra = extraRaw;
486+
note.Tag = extraRaw;
487487
}
488488

489489
private static int HexCharToInt(char c)

tests/chu/ChuTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static ChuNote UgcNoteScaledToC2sTicks(ChuNote n, int ticksPerBeat)
6969
Cell = n.Cell, Width = n.Width,
7070
HoldDuration = scaleDown(n.HoldDuration), SlideDuration = scaleDown(n.SlideDuration),
7171
EndCell = n.EndCell, EndWidth = n.EndWidth,
72-
Extra = n.Extra, TargetNote = n.TargetNote, AirHoldDuration = scaleDown(n.AirHoldDuration),
72+
Tag = n.Tag, TargetNote = n.TargetNote, AirHoldDuration = scaleDown(n.AirHoldDuration),
7373
StartHeight = n.StartHeight, TargetHeight = n.TargetHeight, NoteColor = n.NoteColor,
7474
};
7575
}

0 commit comments

Comments
 (0)