Пример #1
0
        public static TMogSet FromSet(Entities.Set set)
        {
            var slotMan = new SlotManager(set.Slots);
            var tmogSet = Mapper.Map <TMogSet>(set);

            tmogSet.Slots = set.Items
                            .GroupBy(i => i.Slot)
                            .OrderBy(i => slotMan.IsComplete(i.Key))
                            .ThenBy(i => i.Key.ToString())
                            .Select(i => new Slot
            {
                Name     = i.Key.ToString(),
                Items    = Mapper.Map <IEnumerable <Item> >(i),
                Complete = slotMan.IsComplete(i.Key)
            });

            return(tmogSet);
        }