Split (judge) area definition from judges
list.
This commit is contained in:
@@ -33,7 +33,8 @@ namespace Cryville.Crtr {
|
||||
[Binder(typeof(PdtBinder))]
|
||||
public class PdtRuleset {
|
||||
public Dictionary<Identifier, InputDefinition> inputs;
|
||||
public JudgeDefinitionCollection judges;
|
||||
public Dictionary<Identifier, PdtExpression> areas;
|
||||
public Dictionary<Identifier, JudgeDefinition> judges;
|
||||
public Dictionary<Identifier, ScoreDefinition> scores;
|
||||
public Constraint constraints;
|
||||
public void Optimize(PdtEvaluatorBase etor) {
|
||||
@@ -43,15 +44,15 @@ namespace Cryville.Crtr {
|
||||
etor.Optimize(e.Value);
|
||||
}
|
||||
}
|
||||
foreach (var j in judges.Judges) {
|
||||
foreach (var a in areas) {
|
||||
etor.Optimize(a.Value);
|
||||
}
|
||||
foreach (var j in judges) {
|
||||
var judge = j.Value;
|
||||
if (judge.hit != null) etor.Optimize(judge.hit);
|
||||
if (judge.on_hit != null) OptimizeJudgeActions(judge.on_hit, etor);
|
||||
if (judge.on_miss != null) OptimizeJudgeActions(judge.on_miss, etor);
|
||||
}
|
||||
foreach (var a in judges.Areas) {
|
||||
etor.Optimize(a.Value);
|
||||
}
|
||||
foreach (var s in scores) {
|
||||
var score = s.Value;
|
||||
if (score.value != null) etor.Optimize(score.value);
|
||||
@@ -71,12 +72,6 @@ namespace Cryville.Crtr {
|
||||
public bool notnull;
|
||||
public PairList<Identifier, PdtExpression> pass;
|
||||
}
|
||||
public class JudgeDefinitionCollection {
|
||||
[ElementList]
|
||||
public Dictionary<Identifier, JudgeDefinition> Judges = new Dictionary<Identifier, JudgeDefinition>();
|
||||
[PropertyList]
|
||||
public Dictionary<Identifier, PdtExpression> Areas = new Dictionary<Identifier, PdtExpression>();
|
||||
}
|
||||
public class JudgeDefinition {
|
||||
public int stack;
|
||||
public int prop;
|
||||
|
Reference in New Issue
Block a user