Example #1
0
 public static void SortWithPriorityList(List <SortableEquipment> list, List <EquipmentSortMethod> priorityList)
 {
     list.Sort((SortableEquipment a, SortableEquipment b) => ArmorySortUtils.SortWithList(a, b, priorityList));
 }
Example #2
0
        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);
        }
Example #3
0
 public unsafe static long $Invoke11(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.SortWithList((SortableEquipment)GCHandledObjects.GCHandleToObject(*args), (SortableEquipment)GCHandledObjects.GCHandleToObject(args[1]), (List <EquipmentSortMethod>)GCHandledObjects.GCHandleToObject(args[2]))));
 }
Example #4
0
 public unsafe static long $Invoke12(long instance, long *args)
 {
     ArmorySortUtils.SortWithPriorityList((List <SortableEquipment>)GCHandledObjects.GCHandleToObject(*args), (List <EquipmentSortMethod>)GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }
Example #5
0
 public unsafe static long $Invoke10(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.SortByUnlockedEquipment((SortableEquipment)GCHandledObjects.GCHandleToObject(*args), (SortableEquipment)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Example #6
0
 public unsafe static long $Invoke7(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.SortByIncrementingEmptyIndex((SortableEquipment)GCHandledObjects.GCHandleToObject(*args), (SortableEquipment)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Example #7
0
 public unsafe static long $Invoke2(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.SortAlphabetically((SortableEquipment)GCHandledObjects.GCHandleToObject(*args), (SortableEquipment)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Example #8
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.RemoveWrapper((List <SortableEquipment>)GCHandledObjects.GCHandleToObject(*args))));
 }
Example #9
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ArmorySortUtils.CreateSortDictionary()));
 }