Update chart data structure. Add judge event.

This commit is contained in:
2022-10-28 11:14:29 +08:00
parent fee78cd448
commit adb25fda31
2 changed files with 34 additions and 6 deletions

View File

@@ -235,9 +235,9 @@ namespace Cryville.Crtr {
public List<Note> notes = new List<Note>();
public override IEnumerable<ChartEvent> Events {
get {
return tracks.Cast<ChartEvent>()
return base.Events
.Concat(notes.Cast<ChartEvent>()
.Concat(motions.Cast<ChartEvent>()
.Concat(tracks.Cast<ChartEvent>()
));
}
}
@@ -363,7 +363,16 @@ namespace Cryville.Crtr {
}
public class Note : EventContainer {
public Note() : base() {
public List<Judge> judges = new List<Judge>();
public override IEnumerable<ChartEvent> Events {
get {
return base.Events
.Concat(judges.Cast<ChartEvent>()
);
}
}
public Note() {
SubmitPropSrc("judge", new PropSrc.String(() => judge));
SubmitPropSrc("endjudge", new PropSrc.String(() => endjudge));
SubmitPropSrc("track", new PropSrc.Float(() => {
@@ -375,14 +384,33 @@ namespace Cryville.Crtr {
SubmitPropOp("endjudge", new PropOp.String(v => endjudge = v));
}
[Obsolete]
public string judge;
[Obsolete]
public string endjudge;
public override EventList GetEventsOfType(string type) {
switch (type) {
case "judges": return new EventList<Judge>(judges);
default: return base.GetEventsOfType(type);
}
}
public override int Priority {
get { return 2; }
}
}
public class Judge : ChartEvent {
public string name;
public override int Priority {
get { return 4; }
}
public Judge() {
SubmitPropSrc("name", new PropSrc.String(() => name));
SubmitPropOp("name", new PropOp.String(v => name = v));
}
}
// TODO [Obsolete]
public List<Signature> sigs; // Signatures
// TODO [Obsolete]

View File

@@ -98,8 +98,8 @@ namespace Cryville.Crtr {
{ "ctrl0" , new MotionRegistry(typeof(VecCtrl)) },
{ "ctrl1" , new MotionRegistry(typeof(VecCtrl)) },
{ "track" , new MotionRegistry(typeof(Vec1)) },
{ "judge" , new MotionRegistry(typeof(Vec1)) },
{ "width" , new MotionRegistry(new Vec1(0), new Vec1(1)) },
// { "judge" , new MotionRegistry(typeof(Vec1)) },
// { "width" , new MotionRegistry(new Vec1(0), new Vec1(1)) },
};
var dir = new DirectoryInfo(Settings.Default.GameDataPath + "/charts");