Remove some dedicated properties on ISkinnableGroup.
This commit is contained in:
@@ -8,10 +8,9 @@ using System.Runtime.CompilerServices;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Event {
|
namespace Cryville.Crtr.Event {
|
||||||
public abstract class ContainerHandler {
|
public abstract class ContainerHandler : ISkinnableGroup {
|
||||||
#region Struct
|
#region Struct
|
||||||
public ContainerHandler() { }
|
public ContainerHandler() { }
|
||||||
public abstract string TypeName { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prehandling <see cref="ContainerState"/>, prehandling the events.
|
/// Prehandling <see cref="ContainerState"/>, prehandling the events.
|
||||||
@@ -42,7 +41,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
/// <see cref="GameObject"/> group, the <see cref="Transform"/> containing all the generated elements in the <see cref="ContainerHandler"/>.
|
/// <see cref="GameObject"/> group, the <see cref="Transform"/> containing all the generated elements in the <see cref="ContainerHandler"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected Transform gogroup;
|
protected Transform gogroup;
|
||||||
public SkinContext SkinContext;
|
|
||||||
|
|
||||||
public Vector3 Position { get; protected set; }
|
public Vector3 Position { get; protected set; }
|
||||||
public Quaternion Rotation { get; protected set; }
|
public Quaternion Rotation { get; protected set; }
|
||||||
@@ -79,7 +77,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
public readonly Dictionary<int, List<Anchor>> Anchors = new Dictionary<int, List<Anchor>>();
|
public readonly Dictionary<int, List<Anchor>> Anchors = new Dictionary<int, List<Anchor>>();
|
||||||
public readonly Dictionary<int, Anchor> DynamicAnchors = new Dictionary<int, Anchor>();
|
public readonly Dictionary<int, Anchor> DynamicAnchors = new Dictionary<int, Anchor>();
|
||||||
public readonly Dictionary<int, bool> DynamicAnchorSet = new Dictionary<int, bool>();
|
public readonly Dictionary<int, bool> DynamicAnchorSet = new Dictionary<int, bool>();
|
||||||
public Anchor OpenedAnchor;
|
|
||||||
Anchor a_cur;
|
Anchor a_cur;
|
||||||
Anchor a_head;
|
Anchor a_head;
|
||||||
Anchor a_tail;
|
Anchor a_tail;
|
||||||
@@ -127,7 +124,11 @@ namespace Cryville.Crtr.Event {
|
|||||||
a_tail = RegisterAnchor(_a_tail, true);
|
a_tail = RegisterAnchor(_a_tail, true);
|
||||||
}
|
}
|
||||||
public virtual void Init() {
|
public virtual void Init() {
|
||||||
skinContainer.MatchStatic(ps);
|
ChartPlayer.etor.ContextState = ps;
|
||||||
|
ChartPlayer.etor.ContextEvent = Container;
|
||||||
|
skinContainer.MatchStatic(this);
|
||||||
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
|
ChartPlayer.etor.ContextState = null;
|
||||||
foreach (var i in gogroup.GetComponentsInChildren<SkinComponent>())
|
foreach (var i in gogroup.GetComponentsInChildren<SkinComponent>())
|
||||||
i.Init();
|
i.Init();
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
tev.Target.Transform.position = Position;
|
tev.Target.Transform.position = Position;
|
||||||
tev.Target.Transform.rotation = Rotation;
|
tev.Target.Transform.rotation = Rotation;
|
||||||
#endif
|
#endif
|
||||||
skinContainer.MatchDynamic(s);
|
MatchDynamic(s, 1);
|
||||||
CloseAnchor();
|
CloseAnchor();
|
||||||
}
|
}
|
||||||
if (tev.Target == a_head) {
|
if (tev.Target == a_head) {
|
||||||
@@ -171,7 +172,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
anchorEvPool.Return(tev);
|
anchorEvPool.Return(tev);
|
||||||
}
|
}
|
||||||
else if (gogroup && s.CloneType == 2) skinContainer.MatchDynamic(s);
|
else if (gogroup && s.CloneType == 2) MatchDynamic(s, 1);
|
||||||
}
|
}
|
||||||
#region End methods
|
#region End methods
|
||||||
public virtual void EndGraphicalUpdate(ContainerState s) { }
|
public virtual void EndGraphicalUpdate(ContainerState s) { }
|
||||||
@@ -185,15 +186,25 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
public virtual void DisposeAll() { }
|
public virtual void DisposeAll() { }
|
||||||
#endregion
|
#endregion
|
||||||
|
#region Utils
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
protected static bool CanDoGraphicalUpdate(ContainerState s) { return s.CloneType >= 2 && s.CloneType < 16; }
|
protected static bool CanDoGraphicalUpdate(ContainerState s) { return s.CloneType >= 2 && s.CloneType < 16; }
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
void MatchDynamic(ContainerState s, int dl) {
|
||||||
|
ChartPlayer.etor.ContextState = s;
|
||||||
|
ChartPlayer.etor.ContextEvent = Container;
|
||||||
|
skinContainer.MatchDynamic(this, dl);
|
||||||
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
|
ChartPlayer.etor.ContextState = null;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
#region Anchor
|
#region Anchor
|
||||||
public virtual void Anchor() {
|
public virtual void Anchor() {
|
||||||
foreach (var p in PropSrcs.Values) p.Invalidate();
|
foreach (var p in PropSrcs.Values) p.Invalidate();
|
||||||
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
||||||
atime_head = cs.StampedContainer.Time;
|
atime_head = cs.StampedContainer.Time;
|
||||||
atime_tail = atime_head + cs.StampedContainer.Duration;
|
atime_tail = atime_head + cs.StampedContainer.Duration;
|
||||||
skinContainer.MatchDynamic(cs);
|
MatchDynamic(cs, 0);
|
||||||
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
||||||
if (Alive) {
|
if (Alive) {
|
||||||
if (!DynamicAnchorSet[_a_head]) PushAnchorEvent(atime_head, a_head, -1, true);
|
if (!DynamicAnchorSet[_a_head]) PushAnchorEvent(atime_head, a_head, -1, true);
|
||||||
@@ -203,20 +214,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
static readonly SimpleObjectPool<StampedEvent.Anchor> anchorEvPool
|
static readonly SimpleObjectPool<StampedEvent.Anchor> anchorEvPool
|
||||||
= new SimpleObjectPool<StampedEvent.Anchor>(1024);
|
= new SimpleObjectPool<StampedEvent.Anchor>(1024);
|
||||||
public void PushAnchorEvent(double time, int name) {
|
|
||||||
Anchor anchor;
|
|
||||||
if (!DynamicAnchors.TryGetValue(name, out anchor))
|
|
||||||
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.SharedInstance.Retrieve(name)));
|
|
||||||
if (DynamicAnchorSet[name])
|
|
||||||
throw new InvalidOperationException(string.Format("Specified anchor \"{0}\" has been set", IdentifierManager.SharedInstance.Retrieve(name)));
|
|
||||||
int priority = 0;
|
|
||||||
bool forced = true;
|
|
||||||
if (name == _a_head) { priority = -1; atime_head = time; }
|
|
||||||
else if (name == _a_tail) { priority = 1; atime_tail = time; }
|
|
||||||
else forced = false;
|
|
||||||
PushAnchorEvent(time, anchor, priority, forced);
|
|
||||||
DynamicAnchorSet[name] = true;
|
|
||||||
}
|
|
||||||
void PushAnchorEvent(double time, Anchor anchor, int priority = 0, bool forced = false) {
|
void PushAnchorEvent(double time, Anchor anchor, int priority = 0, bool forced = false) {
|
||||||
var tev = anchorEvPool.Rent();
|
var tev = anchorEvPool.Rent();
|
||||||
tev.Time = time;
|
tev.Time = time;
|
||||||
@@ -233,5 +230,34 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ISkinnableGroup
|
||||||
|
public abstract string TypeName { get; }
|
||||||
|
public SkinContext SkinContext { get; set; }
|
||||||
|
public Anchor OpenedAnchor { get; set; }
|
||||||
|
public bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result) {
|
||||||
|
List<Anchor> anchors;
|
||||||
|
var ret = Anchors.TryGetValue(name, out anchors);
|
||||||
|
result = anchors;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
void ISkinnableGroup.RegisterAnchor(int name) {
|
||||||
|
RegisterAnchor(name, true);
|
||||||
|
}
|
||||||
|
public void PushAnchorEvent(double time, int name) {
|
||||||
|
Anchor anchor;
|
||||||
|
if (!DynamicAnchors.TryGetValue(name, out anchor))
|
||||||
|
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||||
|
if (DynamicAnchorSet[name])
|
||||||
|
throw new InvalidOperationException(string.Format("Specified anchor \"{0}\" has been set", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||||
|
int priority = 0;
|
||||||
|
bool forced = true;
|
||||||
|
if (name == _a_head) { priority = -1; atime_head = time; }
|
||||||
|
else if (name == _a_tail) { priority = 1; atime_tail = time; }
|
||||||
|
else forced = false;
|
||||||
|
PushAnchorEvent(time, anchor, priority, forced);
|
||||||
|
DynamicAnchorSet[name] = true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using System.Runtime.CompilerServices;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Event {
|
namespace Cryville.Crtr.Event {
|
||||||
public class ContainerState : ISkinnableGroup {
|
public class ContainerState {
|
||||||
#region Struct
|
#region Struct
|
||||||
public EventBus Bus;
|
public EventBus Bus;
|
||||||
public EventContainer Container;
|
public EventContainer Container;
|
||||||
@@ -466,26 +466,5 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ISkinnableGroup
|
|
||||||
public int DynamicLevel { get { return CloneType >> 1; } }
|
|
||||||
public string TypeName { get { return Handler.TypeName; } }
|
|
||||||
public ContainerState State { get { return this; } }
|
|
||||||
EventContainer ISkinnableGroup.Container { get { return Container; } }
|
|
||||||
public SkinContext SkinContext { get { return Handler.SkinContext; } }
|
|
||||||
public Anchor OpenedAnchor { get { return Handler.OpenedAnchor; } }
|
|
||||||
public bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result) {
|
|
||||||
List<Anchor> anchors;
|
|
||||||
var ret = Handler.Anchors.TryGetValue(name, out anchors);
|
|
||||||
result = anchors;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
public void RegisterAnchor(int name) {
|
|
||||||
Handler.RegisterAnchor(name, true);
|
|
||||||
}
|
|
||||||
public void PushAnchorEvent(double time, int name) {
|
|
||||||
Handler.PushAnchorEvent(time, name);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ namespace Cryville.Crtr {
|
|||||||
public void MatchStatic(ISkinnableGroup group) {
|
public void MatchStatic(ISkinnableGroup group) {
|
||||||
var stack = _stacks[0];
|
var stack = _stacks[0];
|
||||||
stack.Clear();
|
stack.Clear();
|
||||||
if (group.State != null) ChartPlayer.etor.ContextState = group.State;
|
|
||||||
if (group.Container != null) ChartPlayer.etor.ContextEvent = group.Container;
|
|
||||||
MatchStatic(_rootElement, group, stack, new RuntimeSkinContext(group.SkinContext));
|
MatchStatic(_rootElement, group, stack, new RuntimeSkinContext(group.SkinContext));
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
|
||||||
ChartPlayer.etor.ContextState = null;
|
|
||||||
}
|
}
|
||||||
void MatchStatic(SkinElement rel, ISkinnableGroup group, DynamicStack stack, RuntimeSkinContext ctx) {
|
void MatchStatic(SkinElement rel, ISkinnableGroup group, DynamicStack stack, RuntimeSkinContext ctx) {
|
||||||
var rc = ctx.ReadContext;
|
var rc = ctx.ReadContext;
|
||||||
@@ -70,17 +66,15 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||||
}
|
}
|
||||||
public void MatchDynamic(ISkinnableGroup group) {
|
public void MatchDynamic(ISkinnableGroup group, int dl) {
|
||||||
var stack = _stacks[group.DynamicLevel];
|
var stack = _stacks[dl];
|
||||||
var nstack = group.DynamicLevel + 1 < _stacks.Length ? _stacks[group.DynamicLevel + 1] : null;
|
|
||||||
if (nstack != null) nstack.Clear();
|
|
||||||
if (stack.Properties.Count == 0 && stack.Elements.Count == 0) return;
|
if (stack.Properties.Count == 0 && stack.Elements.Count == 0) return;
|
||||||
|
var nstack = dl + 1 < _stacks.Length ? _stacks[dl + 1] : null;
|
||||||
|
if (nstack != null) nstack.Clear();
|
||||||
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
||||||
if (group.State != null) ChartPlayer.etor.ContextState = group.State;
|
|
||||||
if (group.Container != null) ChartPlayer.etor.ContextEvent = group.Container;
|
|
||||||
for (int i = 0; i < stack.Properties.Count; i++) {
|
for (int i = 0; i < stack.Properties.Count; i++) {
|
||||||
DynamicProperty p = stack.Properties[i];
|
DynamicProperty p = stack.Properties[i];
|
||||||
p.Key.ExecuteDynamic(group, p.Context, p.Value);
|
p.Key.ExecuteDynamic(group, p.Context, p.Value, dl);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < stack.Elements.Count; i++) {
|
for (int i = 0; i < stack.Elements.Count; i++) {
|
||||||
DynamicElement e = stack.Elements[i];
|
DynamicElement e = stack.Elements[i];
|
||||||
@@ -94,27 +88,25 @@ namespace Cryville.Crtr {
|
|||||||
if (nstack == null) throw;
|
if (nstack == null) throw;
|
||||||
nstack.Elements.Add(e);
|
nstack.Elements.Add(e);
|
||||||
}
|
}
|
||||||
if (nctx != null) MatchDynamic(e.Element, group, nstack, new RuntimeSkinContext(
|
if (nctx != null) MatchDynamic(e.Element, group, dl, nstack, new RuntimeSkinContext(
|
||||||
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
||||||
));
|
));
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||||
}
|
}
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
|
||||||
ChartPlayer.etor.ContextState = null;
|
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
void MatchDynamic(SkinElement rel, ISkinnableGroup group, DynamicStack stack, RuntimeSkinContext ctx) {
|
void MatchDynamic(SkinElement rel, ISkinnableGroup group, int dl, DynamicStack stack, RuntimeSkinContext ctx) {
|
||||||
var rc = ctx.ReadContext;
|
var rc = ctx.ReadContext;
|
||||||
ChartPlayer.etor.ContextTransform = rc.Transform;
|
ChartPlayer.etor.ContextTransform = rc.Transform;
|
||||||
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeInsert(rc.PropSrcs);
|
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeInsert(rc.PropSrcs);
|
||||||
foreach (var p in rel.properties) {
|
foreach (var p in rel.properties) {
|
||||||
p.Key.ExecuteDynamic(group, ctx, p.Value);
|
p.Key.ExecuteDynamic(group, ctx, p.Value, dl);
|
||||||
}
|
}
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
foreach (var e in rel.elements) {
|
foreach (var e in rel.elements) {
|
||||||
if (e.Key.IsUpdatable(group)) {
|
if (e.Key.IsUpdatable(group, dl)) {
|
||||||
SkinContext nctx = e.Key.MatchDynamic(group, rc);
|
SkinContext nctx = e.Key.MatchDynamic(group, rc);
|
||||||
if (nctx != null) MatchDynamic(e.Value, group, stack, new RuntimeSkinContext(
|
if (nctx != null) MatchDynamic(e.Value, group, dl, stack, new RuntimeSkinContext(
|
||||||
nctx, ctx, e.Key.annotations.Contains("if"), e.Key.annotations.Contains("then")
|
nctx, ctx, e.Key.annotations.Contains("if"), e.Key.annotations.Contains("then")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -163,10 +155,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public interface ISkinnableGroup {
|
public interface ISkinnableGroup {
|
||||||
int DynamicLevel { get; }
|
|
||||||
string TypeName { get; }
|
string TypeName { get; }
|
||||||
ContainerState State { get; }
|
|
||||||
EventContainer Container { get; }
|
|
||||||
SkinContext SkinContext { get; }
|
SkinContext SkinContext { get; }
|
||||||
Anchor OpenedAnchor { get; }
|
Anchor OpenedAnchor { get; }
|
||||||
bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result);
|
bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Cryville.Crtr {
|
|||||||
public abstract override string ToString();
|
public abstract override string ToString();
|
||||||
public abstract bool IsValueRequired { get; }
|
public abstract bool IsValueRequired { get; }
|
||||||
public abstract void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp);
|
public abstract void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp);
|
||||||
public abstract void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp);
|
public abstract void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl);
|
||||||
public class CreateComponent : SkinPropertyKey {
|
public class CreateComponent : SkinPropertyKey {
|
||||||
public Type Component { get; set; }
|
public Type Component { get; set; }
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
@@ -19,7 +19,7 @@ namespace Cryville.Crtr {
|
|||||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||||
ctx.WriteTransform.gameObject.AddComponent(Component);
|
ctx.WriteTransform.gameObject.AddComponent(Component);
|
||||||
}
|
}
|
||||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
|
||||||
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
|
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,9 @@ namespace Cryville.Crtr {
|
|||||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||||
Execute(ctx, GetPropOp(ctx.WriteTransform).Operator, exp);
|
Execute(ctx, GetPropOp(ctx.WriteTransform).Operator, exp);
|
||||||
}
|
}
|
||||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
|
||||||
var prop = GetPropOp(ctx.WriteTransform);
|
var prop = GetPropOp(ctx.WriteTransform);
|
||||||
if (group.DynamicLevel > prop.UpdateDynamicLevel) return;
|
if (dl > prop.UpdateDynamicLevel) return;
|
||||||
Execute(ctx, prop.Operator, exp);
|
Execute(ctx, prop.Operator, exp);
|
||||||
}
|
}
|
||||||
void Execute(RuntimeSkinContext ctx, PdtOperator op, PdtExpression exp) {
|
void Execute(RuntimeSkinContext ctx, PdtOperator op, PdtExpression exp) {
|
||||||
@@ -69,7 +69,7 @@ namespace Cryville.Crtr {
|
|||||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||||
group.RegisterAnchor(Name);
|
group.RegisterAnchor(Name);
|
||||||
}
|
}
|
||||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
|
||||||
throw new InvalidOperationException("Anchor creation in dynamic context is not allowed");
|
throw new InvalidOperationException("Anchor creation in dynamic context is not allowed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,8 +87,8 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
float _time;
|
float _time;
|
||||||
readonly PropOp _timeOp;
|
readonly PropOp _timeOp;
|
||||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
|
||||||
if (group.DynamicLevel > 0) return;
|
if (dl > 0) return;
|
||||||
var psrcs = ctx.ReadContext.PropSrcs;
|
var psrcs = ctx.ReadContext.PropSrcs;
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
||||||
ChartPlayer.etor.Evaluate(_timeOp, exp);
|
ChartPlayer.etor.Evaluate(_timeOp, exp);
|
||||||
@@ -106,7 +106,7 @@ namespace Cryville.Crtr {
|
|||||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
|
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
public bool IsUpdatable(ISkinnableGroup g) {
|
public bool IsUpdatable(ISkinnableGroup g, int dl) {
|
||||||
foreach (var s in selectors)
|
foreach (var s in selectors)
|
||||||
if (!s.IsUpdatable(g)) return false;
|
if (!s.IsUpdatable(g, dl)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public SkinContext MatchDynamic(ISkinnableGroup g, SkinContext ctx) {
|
public SkinContext MatchDynamic(ISkinnableGroup g, SkinContext ctx) {
|
||||||
@@ -64,7 +64,7 @@ namespace Cryville.Crtr {
|
|||||||
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
||||||
public virtual IEnumerable<SkinContext> MatchStatic(ISkinnableGroup g, SkinContext c) { throw new SelectorNotAvailableException(); }
|
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 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;
|
return true;
|
||||||
}
|
}
|
||||||
public class CreateObject : SkinSelector {
|
public class CreateObject : SkinSelector {
|
||||||
@@ -103,8 +103,8 @@ namespace Cryville.Crtr {
|
|||||||
public override SkinContext MatchDynamic(ISkinnableGroup g, SkinContext c) {
|
public override SkinContext MatchDynamic(ISkinnableGroup g, SkinContext c) {
|
||||||
return g.OpenedAnchor != null && g.OpenedAnchor.Name == Name ? c : null;
|
return g.OpenedAnchor != null && g.OpenedAnchor.Name == Name ? c : null;
|
||||||
}
|
}
|
||||||
public override bool IsUpdatable(ISkinnableGroup g) {
|
public override bool IsUpdatable(ISkinnableGroup g, int dl) {
|
||||||
return g.DynamicLevel >= 1;
|
return dl >= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class Property : SkinSelector {
|
public class Property : SkinSelector {
|
||||||
|
|||||||
Reference in New Issue
Block a user