public static int SortWithList(SortableEquipment a, SortableEquipment b, List <EquipmentSortMethod> sortingPriority) { Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> dictionary = ArmorySortUtils.CreateSortDictionary(); int i = 0; int count = sortingPriority.Count; while (i < count) { ArmorySortUtils.SortEquipmentDelegate sortEquipmentDelegate = dictionary[sortingPriority[i]]; int num = sortEquipmentDelegate(a, b); if (num != 0) { return(num); } i++; } return(0); }
private static Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> CreateSortDictionary() { Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> dictionary = new Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate>(); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_25_0 = dictionary; EquipmentSortMethod arg_25_1 = EquipmentSortMethod.UnlockedEquipment; if (ArmorySortUtils.< > f__mg$cache0 == null) { ArmorySortUtils.< > f__mg$cache0 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByUnlockedEquipment); } arg_25_0.Add(arg_25_1, ArmorySortUtils.< > f__mg$cache0); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_49_0 = dictionary; EquipmentSortMethod arg_49_1 = EquipmentSortMethod.RequirementsMet; if (ArmorySortUtils.< > f__mg$cache1 == null) { ArmorySortUtils.< > f__mg$cache1 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByRequirementsMet); } arg_49_0.Add(arg_49_1, ArmorySortUtils.< > f__mg$cache1); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_6D_0 = dictionary; EquipmentSortMethod arg_6D_1 = EquipmentSortMethod.CurrentPlanet; if (ArmorySortUtils.< > f__mg$cache2 == null) { ArmorySortUtils.< > f__mg$cache2 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByCurrentPlanet); } arg_6D_0.Add(arg_6D_1, ArmorySortUtils.< > f__mg$cache2); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_91_0 = dictionary; EquipmentSortMethod arg_91_1 = EquipmentSortMethod.CapacitySize; if (ArmorySortUtils.< > f__mg$cache3 == null) { ArmorySortUtils.< > f__mg$cache3 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByCapacitySize); } arg_91_0.Add(arg_91_1, ArmorySortUtils.< > f__mg$cache3); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_B5_0 = dictionary; EquipmentSortMethod arg_B5_1 = EquipmentSortMethod.Quality; if (ArmorySortUtils.< > f__mg$cache4 == null) { ArmorySortUtils.< > f__mg$cache4 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByQuality); } arg_B5_0.Add(arg_B5_1, ArmorySortUtils.< > f__mg$cache4); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_D9_0 = dictionary; EquipmentSortMethod arg_D9_1 = EquipmentSortMethod.Alphabetical; if (ArmorySortUtils.< > f__mg$cache5 == null) { ArmorySortUtils.< > f__mg$cache5 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortAlphabetically); } arg_D9_0.Add(arg_D9_1, ArmorySortUtils.< > f__mg$cache5); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_FD_0 = dictionary; EquipmentSortMethod arg_FD_1 = EquipmentSortMethod.EmptyEquipment; if (ArmorySortUtils.< > f__mg$cache6 == null) { ArmorySortUtils.< > f__mg$cache6 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByEmptyEquipment); } arg_FD_0.Add(arg_FD_1, ArmorySortUtils.< > f__mg$cache6); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_121_0 = dictionary; EquipmentSortMethod arg_121_1 = EquipmentSortMethod.DecrementingIndex; if (ArmorySortUtils.< > f__mg$cache7 == null) { ArmorySortUtils.< > f__mg$cache7 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByDecrementingIndex); } arg_121_0.Add(arg_121_1, ArmorySortUtils.< > f__mg$cache7); Dictionary <EquipmentSortMethod, ArmorySortUtils.SortEquipmentDelegate> arg_145_0 = dictionary; EquipmentSortMethod arg_145_1 = EquipmentSortMethod.IncrementingEmptyIndex; if (ArmorySortUtils.< > f__mg$cache8 == null) { ArmorySortUtils.< > f__mg$cache8 = new ArmorySortUtils.SortEquipmentDelegate(ArmorySortUtils.SortByIncrementingEmptyIndex); } arg_145_0.Add(arg_145_1, ArmorySortUtils.< > f__mg$cache8); return(dictionary); }