Add effect definition.

This commit is contained in:
2023-02-15 15:35:09 +08:00
parent b84d645aee
commit 4a5b2a6889
2 changed files with 15 additions and 1 deletions

View File

@@ -32,7 +32,9 @@ namespace Cryville.Crtr {
} }
[Binder(typeof(PdtBinder))] [Binder(typeof(PdtBinder))]
public class PdtSkin : SkinElement { } public class PdtSkin : SkinElement {
public Dictionary<Identifier, EffectDefinition> effects = new Dictionary<Identifier, EffectDefinition>();
}
public class SkinElement { public class SkinElement {
[ElementList] [ElementList]
@@ -63,4 +65,13 @@ namespace Cryville.Crtr {
} }
} }
} }
public class EffectDefinition {
public Identifier[] args;
public PdtExpression duration;
[ElementList]
public Dictionary<SkinSelectors, SkinElement> elements
= new Dictionary<SkinSelectors, SkinElement>();
}
} }

View File

@@ -13,6 +13,9 @@ namespace Cryville.Crtr {
readonly HashSet<string> a = new HashSet<string>(); readonly HashSet<string> a = new HashSet<string>();
readonly List<string> k = new List<string>(2); readonly List<string> k = new List<string>(2);
protected override object InterpretKey(Type type) { protected override object InterpretKey(Type type) {
if (!typeof(SkinElement).IsAssignableFrom(type)) {
return base.InterpretKey(type);
}
s.Clear(); a.Clear(); k.Clear(); s.Clear(); a.Clear(); k.Clear();
bool invalidKeyFlag = false, compKeyFlag = false; bool invalidKeyFlag = false, compKeyFlag = false;
while (true) { while (true) {