Example #1
0
 private void _DiscoverIntentsFromEffects(TimeSpan currentTime, IEnumerable <IEffectNode> effects, IntentDiscoveryAction intentDiscoveryAction)
 {
     // For each effect in the in-effect list for the context...
     foreach (IEffectNode effectNode in effects)
     {
         // Get a time value relative to the start of the effect.
         TimeSpan effectRelativeTime = Helper.GetEffectRelativeTime(currentTime, effectNode);
         // Get the elements the effect affects at this time and the ways it will do so.
         ElementIntents elementIntents = effectNode.Effect.GetElementIntents(effectRelativeTime);
         // For each element...
         foreach (Guid elementId in elementIntents.ElementIds)
         {
             // Get the intent nodes.
             IIntentNode[] intentNodes = elementIntents[elementId];
             // For each intent node.
             foreach (IIntentNode intentNode in intentNodes)
             {
                 // Get a timing value relative to the intent.
                 TimeSpan intentRelativeTime = Helper.GetIntentRelativeTime(effectRelativeTime, intentNode);
                 // Do whatever is going to be done.
                 intentDiscoveryAction(elementId, intentNode, intentRelativeTime);
             }
         }
     }
 }
Example #2
0
 protected EffectModuleInstanceBase()
 {
     TargetNodes      = new ElementNode[0];
     TimeSpan         = TimeSpan.Zero;
     IsDirty          = true;
     _parameterValues = new DefaultValueArrayMember(this);
     _elementIntents  = new ElementIntents();
 }
Example #3
0
 protected EffectModuleInstanceBase()
 {
     _targetNodes     = new ElementNode[0];         //set member directly on creation to prevent target node changed events from occuring.
     TimeSpan         = TimeSpan.Zero;
     IsDirty          = true;
     _parameterValues = new DefaultValueArrayMember(this);
     _elementIntents  = new ElementIntents();
 }