Introduce IdentifierManager to improve PDT evaluator performance.

This commit is contained in:
2022-11-01 13:47:04 +08:00
parent 3bfc7eb643
commit 2c9be2ef1e
12 changed files with 229 additions and 145 deletions

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Cryville.Common;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -112,19 +113,19 @@ namespace Cryville.Crtr {
}
[JsonIgnore]
public Dictionary<string, PropSrc> PropSrcs { get; private set; }
public Dictionary<int, PropSrc> PropSrcs { get; private set; }
protected void SubmitPropSrc(string name, PropSrc property) {
PropSrcs.Add(name, property);
PropSrcs.Add(IdentifierManager.SharedInstance.Request(name), property);
}
[JsonIgnore]
public Dictionary<string, PropOp> PropOps { get; private set; }
public Dictionary<int, PropOp> PropOps { get; private set; }
protected void SubmitPropOp(string name, PropOp property) {
PropOps.Add(name, property);
PropOps.Add(IdentifierManager.SharedInstance.Request(name), property);
}
protected ChartEvent() {
PropSrcs = new Dictionary<string, PropSrc>();
PropOps = new Dictionary<string, PropOp>();
PropSrcs = new Dictionary<int, PropSrc>();
PropOps = new Dictionary<int, PropOp>();
SubmitPropSrc("long", new PropSrc.Boolean(() => IsLong));
SubmitPropSrc("time", new PropSrc.BeatTime(() => time.Value));
SubmitPropSrc("endtime", new PropSrc.BeatTime(() => endtime.Value));