public int CompareTo(object obj) { TimelineElement other = (TimelineElement)obj; return(this.time.CompareTo(other.time)); }
public void Add(TimelineElement param) { this.elements.Add(param); this.elements.Sort(); // keep the list sorted by time }
private const double EPSILON = 0.00001; // smallest distinguishable time delta static internal double ComputeAlpha(double time, TimelineElement previous, TimelineElement next) { if (previous == null || next == null) return 1; double delta = next.Time - previous.Time; if ((delta - EPSILON) <= 0) return 1; return time / delta; }