示例#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);
             }
         }
     }
 }
示例#2
0
 private void _DiscoverIntentsFromCurrentEffects(TimeSpan currentTime, IntentDiscoveryAction intentDiscoveryAction)
 {
     _DiscoverIntentsFromEffects(currentTime, _currentEffects, intentDiscoveryAction);
 }