Code cleanup.
This commit is contained in:
@@ -348,38 +348,6 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region Definitions
|
||||
public class InputDefinition {
|
||||
public int dim;
|
||||
public string pdim;
|
||||
public bool notnull;
|
||||
public PairList<Identifier, PdtExpression> pass;
|
||||
}
|
||||
public class JudgeDefinition {
|
||||
public PdtExpression clip;
|
||||
public PdtExpression input;
|
||||
public PdtExpression hit;
|
||||
public PdtExpression persist;
|
||||
public Identifier[] pass;
|
||||
public Identifier[] miss;
|
||||
public PairList<ScoreOperation, PdtExpression> scores;
|
||||
public int stack;
|
||||
public int prop = 1;
|
||||
}
|
||||
public class ScoreOperation {
|
||||
public Identifier name;
|
||||
public Identifier op;
|
||||
public override string ToString() {
|
||||
if (op == default(Identifier)) return name.ToString();
|
||||
else return string.Format("{0} {1}", name, op);
|
||||
}
|
||||
}
|
||||
public class ScoreDefinition {
|
||||
public PdtExpression value;
|
||||
public float init = 0;
|
||||
public string format = "";
|
||||
}
|
||||
#endregion
|
||||
|
||||
[Serializable]
|
||||
public class JudgePropagationException : Exception {
|
||||
|
||||
@@ -65,12 +65,42 @@ namespace Cryville.Crtr {
|
||||
constraints.PrePatch(chart);
|
||||
}
|
||||
}
|
||||
public class InputDefinition {
|
||||
public int dim;
|
||||
public string pdim;
|
||||
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;
|
||||
public PdtExpression clip;
|
||||
public PdtExpression input;
|
||||
public PdtExpression hit;
|
||||
public PdtExpression persist; // TODO Compat
|
||||
public Identifier[] pass; // TODO Compat
|
||||
public Identifier[] miss; // TODO Compat
|
||||
public PairList<ScoreOperation, PdtExpression> scores; // TODO Compat
|
||||
}
|
||||
public class ScoreOperation {
|
||||
public Identifier name;
|
||||
public Identifier op;
|
||||
public override string ToString() {
|
||||
if (op == default(Identifier)) return name.ToString();
|
||||
else return string.Format("{0} {1}", name, op);
|
||||
}
|
||||
}
|
||||
public class ScoreDefinition {
|
||||
public PdtExpression value;
|
||||
public float init = 0;
|
||||
public string format = "";
|
||||
}
|
||||
public class Constraint {
|
||||
static readonly PropOp.Arbitrary _arbop = new PropOp.Arbitrary();
|
||||
[ElementList]
|
||||
|
||||
@@ -10,7 +10,12 @@ namespace Cryville.Crtr {
|
||||
readonly List<RulesetSelector> s = new List<RulesetSelector>();
|
||||
readonly List<string> a = new List<string>();
|
||||
protected override object InterpretKey(Type type) {
|
||||
if (type == typeof(Constraint)) {
|
||||
if (type == typeof(Constraint))
|
||||
return InterpretConstraintKey();
|
||||
else
|
||||
return base.InterpretKey(type);
|
||||
}
|
||||
object InterpretConstraintKey() {
|
||||
s.Clear(); a.Clear();
|
||||
string key = "";
|
||||
while (true) {
|
||||
@@ -50,7 +55,5 @@ namespace Cryville.Crtr {
|
||||
if (Position == pp) throw new FormatException("Invalid selector or key format");
|
||||
}
|
||||
}
|
||||
else return base.InterpretKey(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user