public bool CheckHpConditional(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> target, int iParam)
        {
            if (!src || !target)
            {
                return(false);
            }
            ulong propertyHpRate  = TargetProperty.GetPropertyHpRate(src, 5);
            ulong propertyHpRate2 = TargetProperty.GetPropertyHpRate(target, 5);

            return(SmartCompare.Compare <ulong>(propertyHpRate, propertyHpRate2, iParam));
        }
示例#2
0
 private void SortActorListByTag(PoolObjHandle <ActorRoot> InActor, ref List <ActorRoot> actorList, SelectEnemyType type)
 {
     if (actorList.Count > 1)
     {
         int     count    = actorList.Count;
         ulong[] numArray = new ulong[count];
         if (type == SelectEnemyType.SelectLowHp)
         {
             numArray[0] = TargetProperty.GetPropertyHpRate(actorList[0], RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP);
         }
         else
         {
             VInt3 num5 = InActor.handle.location - actorList[0].location;
             numArray[0] = (ulong)num5.sqrMagnitudeLong2D;
         }
         ulong propertyHpRate = 0L;
         for (int i = 1; i < count; i++)
         {
             ActorRoot root = actorList[i];
             if (type == SelectEnemyType.SelectLowHp)
             {
                 propertyHpRate = TargetProperty.GetPropertyHpRate(root, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP);
             }
             else
             {
                 VInt3 num6 = InActor.handle.location - actorList[0].location;
                 propertyHpRate = (ulong)num6.sqrMagnitudeLong2D;
             }
             numArray[i] = propertyHpRate;
             int index = i;
             while (index >= 1)
             {
                 if (propertyHpRate >= numArray[index - 1])
                 {
                     break;
                 }
                 numArray[index]  = numArray[index - 1];
                 actorList[index] = actorList[index - 1];
                 index--;
             }
             numArray[index]  = propertyHpRate;
             actorList[index] = root;
         }
     }
 }
示例#3
0
        private void SortActorListByTag(PoolObjHandle <ActorRoot> InActor, ref List <ActorRoot> actorList, SelectEnemyType type)
        {
            if (actorList.get_Count() <= 1)
            {
                return;
            }
            int count = actorList.get_Count();

            ulong[] array = new ulong[count];
            if (type == SelectEnemyType.SelectLowHp)
            {
                array[0] = TargetProperty.GetPropertyHpRate(actorList.get_Item(0), RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP);
            }
            else
            {
                array[0] = (ulong)(InActor.handle.location - actorList.get_Item(0).location).sqrMagnitudeLong2D;
            }
            for (int i = 1; i < count; i++)
            {
                ActorRoot actorRoot = actorList.get_Item(i);
                ulong     num;
                if (type == SelectEnemyType.SelectLowHp)
                {
                    num = TargetProperty.GetPropertyHpRate(actorRoot, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP);
                }
                else
                {
                    num = (ulong)(InActor.handle.location - actorList.get_Item(0).location).sqrMagnitudeLong2D;
                }
                array[i] = num;
                int j;
                for (j = i; j >= 1; j--)
                {
                    if (num >= array[j - 1])
                    {
                        break;
                    }
                    array[j] = array[j - 1];
                    actorList.set_Item(j, actorList.get_Item(j - 1));
                }
                array[j] = num;
                actorList.set_Item(j, actorRoot);
            }
        }