コード例 #1
0
ファイル: Model.cs プロジェクト: cosmolen/act_timeline
        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;
        }
コード例 #2
0
ファイル: TimelineLoader.cs プロジェクト: RowBan/act_timeline
 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();
 }