Remove some dedicated properties on ISkinnableGroup.

This commit is contained in:
2023-02-17 18:10:46 +08:00
parent 88d35e4eaf
commit 9c08cbf0d2
5 changed files with 72 additions and 78 deletions

View File

@@ -43,9 +43,9 @@ namespace Cryville.Crtr {
}
return result;
}
public bool IsUpdatable(ISkinnableGroup g) {
public bool IsUpdatable(ISkinnableGroup g, int dl) {
foreach (var s in selectors)
if (!s.IsUpdatable(g)) return false;
if (!s.IsUpdatable(g, dl)) return false;
return true;
}
public SkinContext MatchDynamic(ISkinnableGroup g, SkinContext ctx) {
@@ -64,7 +64,7 @@ namespace Cryville.Crtr {
public virtual void Optimize(PdtEvaluatorBase etor) { }
public virtual IEnumerable<SkinContext> MatchStatic(ISkinnableGroup g, SkinContext c) { throw new SelectorNotAvailableException(); }
public virtual SkinContext MatchDynamic(ISkinnableGroup g, SkinContext c) { throw new SelectorNotAvailableException(); }
public virtual bool IsUpdatable(ISkinnableGroup g) {
public virtual bool IsUpdatable(ISkinnableGroup g, int dl) {
return true;
}
public class CreateObject : SkinSelector {
@@ -103,8 +103,8 @@ namespace Cryville.Crtr {
public override SkinContext MatchDynamic(ISkinnableGroup g, SkinContext c) {
return g.OpenedAnchor != null && g.OpenedAnchor.Name == Name ? c : null;
}
public override bool IsUpdatable(ISkinnableGroup g) {
return g.DynamicLevel >= 1;
public override bool IsUpdatable(ISkinnableGroup g, int dl) {
return dl >= 1;
}
}
public class Property : SkinSelector {