Example #1
0
        public IIntentNode[] GetElementIntentsAtTime(Guid elementId, TimeSpan effectRelativeTime)
        {
            IntentNodeCollection elementIntents;

            if (TryGetValue(elementId, out elementIntents))
            {
                return(elementIntents.Where(x => TimeNode.IntersectsInclusively(x, effectRelativeTime)).ToArray());
            }
            return(null);
        }
Example #2
0
        private IntentSegmentNode <TypeOfValue> _GetSegmentIntersecting(TimeSpan intentRelativeTime)
        {
            //Linear search. Just ugly.
            //return _segmentTimeIndex.Values.FirstOrDefault(x => TimeNode.IntersectsExclusively(x, intentRelativeTime));
            //Trying to squeak a little bit more out of this by using a for loop instead of LINQ
            //since we have a concrete, non-deferred collection.
            for (int i = 0; i < _segmentTimeIndex.Count; i++)
            {
                IntentSegmentNode <TypeOfValue> segmentNode = _segmentTimeIndex[_segmentTimeIndex.Keys[i]];
                if (TimeNode.IntersectsExclusively(segmentNode, intentRelativeTime))
                {
                    return(segmentNode);
                }
            }

            return(null);
        }
Example #3
0
 private bool _FilterQualifies(ISequenceFilterNode sequenceFilterNode, ITimeNode timeNode)
 {
     return(TimeNode.IntersectsExclusively(timeNode, sequenceFilterNode));
 }