src/Lurker.UI/ViewModels/BuildTimelineViewModel.cs
/// <summary>
/// Groups the by s kill.
/// </summary>
Groups the by s kill.
Groups the by s kill .
private void GroupBySKill()
        {
            var skillGroups = this._skills.GroupBy(s => s.Gems.Max(g => g.Level));
            foreach (var group in skillGroups)
            {
                var timelineItem = new TimelineItemViewModel(group.Key);
                var wikiItems = new List<WikiItemBaseViewModel>();
                foreach (var entry in group.AsEnumerable())
                {
                    wikiItems.AddRange(entry.Gems.Select(g => new GemViewModel(g)));
                }
                foreach (var item in this._items.Where(i => i.Level == group.Key))
                {
                    wikiItems.Add(new UniqueItemViewModel(item, false));
                }
                timelineItem.DetailedView = new GroupItemViewModel(wikiItems);
                this.Timeline.AddItem(timelineItem);
            }
            foreach (var uniqueItem in this._items)
            {
                if (skillGroups.Any(s => s.Key == uniqueItem.Level))
                {
                    continue;
                }
                var timelineItem = new TimelineItemViewModel(uniqueItem.Level)
                {
                    DetailedView = new UniqueItemViewModel(uniqueItem, false),
                };
                this.Timeline.AddItem(timelineItem);
            }
        }
private void GroupBySKill ( ) { var skillGroups = this . _skills . GroupBy ( s => s . Gems . Max ( g => g . Level ) ) ; foreach ( var group in skillGroups ) { var timelineItem = new TimelineItemViewModel ( group . Key ) ; var wikiItems = new List < WikiItemBaseViewModel > ( ) ; foreach ( var entry in group . AsEnumerable ( ) ) { wikiItems . AddRange ( entry . Gems . Select ( g => new GemViewModel ( g ) ) ) ; } foreach ( var item in this . _items . Where ( i => i . Level == group . Key ) ) { wikiItems . Add ( new UniqueItemViewModel ( item , false ) ) ; } timelineItem . DetailedView = new GroupItemViewModel ( wikiItems ) ; this . Timeline . AddItem ( timelineItem ) ; } foreach ( var uniqueItem in this . _items ) { if ( skillGroups . Any ( s => s . Key == uniqueItem . Level ) ) { continue ; } var timelineItem = new TimelineItemViewModel ( uniqueItem . Level ) { DetailedView = new UniqueItemViewModel ( uniqueItem , false ) , } ; this . Timeline . AddItem ( timelineItem ) ; } }
Groups the by s kill.
Groups the by s kill .