Implement input name evaluation. Implement context state.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Math;
|
||||
using Cryville.Crtr.Components;
|
||||
using Cryville.Crtr.Event;
|
||||
@@ -9,10 +10,12 @@ namespace Cryville.Crtr {
|
||||
class NoteHandler : ContainerHandler {
|
||||
readonly GroupHandler gh;
|
||||
public readonly Chart.Note Event;
|
||||
readonly PdtRuleset ruleset;
|
||||
readonly Judge judge;
|
||||
public NoteHandler(GroupHandler gh, Chart.Note ev, Judge j) : base() {
|
||||
public NoteHandler(GroupHandler gh, Chart.Note ev, PdtRuleset rs, Judge j) : base() {
|
||||
this.gh = gh;
|
||||
Event = ev;
|
||||
ruleset = rs;
|
||||
judge = j;
|
||||
}
|
||||
|
||||
@@ -90,6 +93,15 @@ namespace Cryville.Crtr {
|
||||
else if (s.CloneType == 16) {
|
||||
if (ev == null) { }
|
||||
else if (ev.Unstamped == null) { }
|
||||
else if (ev.Unstamped is Chart.Judge) {
|
||||
var tev = (Chart.Judge)ev.Unstamped;
|
||||
Identifier name;
|
||||
ChartPlayer.etor.ContextEvent = tev;
|
||||
ChartPlayer.etor.ContextState = s;
|
||||
ChartPlayer.etor.Evaluate(new PropOp.Identifier(v => name = new Identifier(v)), ruleset.judges[tev.Id].input);
|
||||
ChartPlayer.etor.ContextState = null;
|
||||
ChartPlayer.etor.ContextEvent = null;
|
||||
}
|
||||
else if (ev.Unstamped is Chart.Motion) {
|
||||
/*var tev = (Chart.Motion)ev.Unstamped;
|
||||
if (tev.Name != "judge") return;
|
||||
|
Reference in New Issue
Block a user