public static List <SlotitemModel> GetSortedList(List <SlotitemModel> slots, SlotitemSortKey sort_key) { List <SlotitemModel> range = slots.GetRange(0, slots.Count); Sort(range, sort_key); return(range); }
public static void Sort(List <SlotitemModel> slots, SlotitemSortKey sort_key) { switch (sort_key) { case SlotitemSortKey.Type3: slots.Sort(delegate(SlotitemModel x, SlotitemModel y) { int num2 = _CompType3(x, y); if (num2 != 0) { return(num2); } num2 = _CompMstId(x, y); return((num2 != 0) ? num2 : _CompGetNo(x, y)); }); break; case SlotitemSortKey.LEVEL_ASCENDING: slots.Sort(delegate(SlotitemModel x, SlotitemModel y) { int num = _CompType3(x, y); if (num != 0) { return(num); } num = _CompMstId(x, y); if (num != 0) { return(num); } num = _CompLevel(x, y); return((num != 0) ? num : _CompGetNo(x, y)); }); break; case SlotitemSortKey.LEVEL_DESCENDING: slots.Sort(delegate(SlotitemModel x, SlotitemModel y) { int num3 = _CompType3(x, y); if (num3 != 0) { return(num3); } num3 = _CompMstId(x, y); if (num3 != 0) { return(num3); } num3 = _CompLevel(x, y) * -1; return((num3 != 0) ? num3 : _CompGetNo(x, y)); }); break; } }