Esempio n. 1
0
        public Timeline(string name, List <TimelineActivity> items_, List <TimelineAnchor> anchors_, List <ActivityAlert> alerts_, AlertSoundAssets soundAssets)
        {
            Name  = name;
            items = items_;
            int i = 0;

            foreach (TimelineActivity a in items_)
            {
                a.Index = i++;
            }
            items.Sort(TimelineActivity.CompareByEndTime);
            itemsEndTime = items.Select(a => a.EndTime).ToList();

            anchors     = anchors_.OrderBy(anchor => anchor.TimeFromStart).ToList();
            anchorsTree = new IntervalTree.IntervalTree <double, TimelineAnchor>();
            foreach (TimelineAnchor a in anchors)
            {
                anchorsTree.Add(a.Interval, a);
            }

            alerts = alerts_;
            alerts.Sort();
            alertsTimeFromStart = alerts.Select(a => a.TimeFromStart).ToList();
            AlertSoundAssets    = soundAssets;

            EndTime = Items.Any() ? Items.Last().EndTime : 0;
        }
Esempio n. 2
0
 public TimelineConfig()
 {
     Items            = new List <TimelineActivity>();
     Anchors          = new List <TimelineAnchor>();
     AlertAlls        = new List <AlertAll>();
     HideAlls         = new List <string>();
     Alerts           = new List <ActivityAlert>();
     AlertSoundAssets = new AlertSoundAssets();
 }