Prune and clean up code.

This commit is contained in:
2023-04-04 20:48:17 +08:00
parent a013d59379
commit c98536e8ab
12 changed files with 23 additions and 377 deletions

View File

@@ -352,6 +352,7 @@ namespace Cryville.Crtr {
[JsonIgnore]
public Identifier Name {
get {
if (name == default(Identifier)) throw new InvalidOperationException("Motion name not set");
return name;
}
private set {
@@ -369,9 +370,9 @@ namespace Cryville.Crtr {
[JsonIgnore]
public MotionNode RelativeNode;
[DefaultValue(TransitionType.Ease)] // TODO [Obsolete]
[DefaultValue(TransitionType.Ease)][Obsolete]
public TransitionType transition = TransitionType.Ease;
[DefaultValue(1.0f)] // TODO [Obsolete]
[DefaultValue(1.0f)][Obsolete]
public float rate = 1.0f;
[DefaultValue(0.0f)]
public float sumfix = 0.0f;
@@ -382,8 +383,8 @@ namespace Cryville.Crtr {
SubmitPropOp("motion", new PropOp.String(v => motion = v));
SubmitPropOp("name", new PropOp.Identifier(v => {
var n = new Identifier(v);
if (Name.Equals(n)) { }
else if (Name.Equals(default(Identifier))) Name = n;
if (name == n) { }
else if (name == default(Identifier)) Name = n;
else throw new RulesetViolationException(string.Format(
"Motion name not matched, expected {0}, got {1}", n, Name
));