private void SortDamageCalModelLv3(List <DamageCalModel> list)
 {
     for (int i = 0; i < list.get_Count(); i++)
     {
         DamageCalModel damageCalModel = list.get_Item(i);
         for (int j = 0; j < damageCalModel.listChildren.get_Count() - 1; j++)
         {
             DamageCalModel damageCalModel2 = damageCalModel.listChildren.get_Item(j);
             for (int k = 0; k < damageCalModel2.listChildren.get_Count(); k++)
             {
                 int num = k;
                 for (int l = k + 1; l < damageCalModel2.listChildren.get_Count(); l++)
                 {
                     DamageCalModel damageCalModel3 = damageCalModel2.listChildren.get_Item(num);
                     DamageCalModel damageCalModel4 = damageCalModel2.listChildren.get_Item(l);
                     if (damageCalModel3.total < damageCalModel4.total)
                     {
                         num = l;
                     }
                 }
                 if (num != k)
                 {
                     XUtility.ListExchange <DamageCalModel>(damageCalModel2.listChildren, num, k);
                 }
             }
         }
     }
 }
    private void ResetPetInfos()
    {
        this.mPetInfos.Clear();
        using (Dictionary <long, PetInfo> .ValueCollection.Enumerator enumerator = PetManager.Instance.MaplistPet.get_Values().GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetInfo current = enumerator.get_Current();
                this.mPetInfos.Add(current);
            }
        }
        for (int i = 0; i < this.mPetInfos.get_Count(); i++)
        {
            int num = i;
            for (int j = i + 1; j < this.mPetInfos.get_Count(); j++)
            {
                Pet pet = DataReader <Pet> .Get(this.mPetInfos.get_Item(num).petId);

                Pet pet2 = DataReader <Pet> .Get(this.mPetInfos.get_Item(j).petId);

                if (pet.summonEnergy < pet2.summonEnergy)
                {
                    num = j;
                }
            }
            if (num != i)
            {
                XUtility.ListExchange <PetInfo>(this.mPetInfos, num, i);
            }
        }
    }
Esempio n. 3
0
 public void OnEndDrag(Transform tr)
 {
     for (int i = 0; i < this.listDragDropItems.get_Count(); i++)
     {
         for (int j = i + 1; j < this.listDragDropItems.get_Count(); j++)
         {
             Transform transform  = this.listDragDropItems.get_Item(i);
             Transform transform2 = this.listDragDropItems.get_Item(j);
             if (transform.get_localPosition().x > transform2.get_localPosition().x)
             {
                 XUtility.ListExchange <Transform>(this.listDragDropItems, i, j);
             }
         }
     }
     this.SetCorrectPlacesEndDrag();
 }
 private void SortDamageCalModelLv1(List <DamageCalModel> list)
 {
     for (int i = 0; i < list.get_Count() - 1; i++)
     {
         int num = i;
         for (int j = i + 1; j < list.get_Count(); j++)
         {
             DamageCalModel damageCalModel  = list.get_Item(num);
             DamageCalModel damageCalModel2 = list.get_Item(j);
             if (damageCalModel.total < damageCalModel2.total)
             {
                 num = j;
             }
         }
         if (i != num)
         {
             XUtility.ListExchange <DamageCalModel>(list, i, num);
         }
     }
 }
 private void SortDamageCalModelLv2(List <DamageCalModel> list)
 {
     for (int i = 0; i < list.get_Count(); i++)
     {
         DamageCalModel damageCalModel = list.get_Item(i);
         for (int j = 0; j < damageCalModel.listChildren.get_Count() - 1; j++)
         {
             int num = j;
             for (int k = j + 1; k < damageCalModel.listChildren.get_Count(); k++)
             {
                 DamageCalModel damageCalModel2 = damageCalModel.listChildren.get_Item(num);
                 DamageCalModel damageCalModel3 = damageCalModel.listChildren.get_Item(k);
                 if (damageCalModel2.total < damageCalModel3.total)
                 {
                     num = k;
                 }
             }
             if (num != j)
             {
                 XUtility.ListExchange <DamageCalModel>(damageCalModel.listChildren, num, j);
             }
         }
     }
 }
Esempio n. 6
0
    private void RefreshInstanceItems(int chapter, DungeonType.ENUM dungeonType)
    {
        this.ResetItems();
        ChapterInfo        chapterInfo = this.listData.get_Item(chapter - 1);
        List <DungeonInfo> list        = new List <DungeonInfo>();

        list.AddRange(chapterInfo.dungeons);
        for (int i = 0; i < list.get_Count(); i++)
        {
            int num = i;
            for (int j = i + 1; j < list.get_Count(); j++)
            {
                DungeonInfo   dungeonInfo   = list.get_Item(num);
                ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo.dungeonId);

                if (zhuXianPeiZhi == null)
                {
                    Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo.dungeonId);
                }
                else
                {
                    DungeonInfo   dungeonInfo2   = list.get_Item(j);
                    ZhuXianPeiZhi zhuXianPeiZhi2 = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo2.dungeonId);

                    if (zhuXianPeiZhi2 == null)
                    {
                        Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo2.dungeonId);
                    }
                    else if (zhuXianPeiZhi.instance > zhuXianPeiZhi2.instance)
                    {
                        num = j;
                    }
                }
            }
            if (num != i)
            {
                XUtility.ListExchange <DungeonInfo>(list, i, num);
            }
        }
        for (int k = 0; k < list.get_Count(); k++)
        {
            DungeonInfo di = list.get_Item(k);
            if (k == 0)
            {
                FuBenJiChuPeiZhi icTmp = DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId);

                ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .DataList.Find((ZhuXianZhangJiePeiZhi a) => a.chapterType == icTmp.type && a.chapterOrder == DataReader <ZhuXianZhangJiePeiZhi> .Get(DataReader <ZhuXianPeiZhi> .Get(di.dungeonId).chapterId).chapterOrder);

                string   chineseContent = GameDataUtils.GetChineseContent(zhuXianZhangJiePeiZhi.chapterName, false);
                string[] array          = chineseContent.Split(new char[]
                {
                    ' '
                });
                this.TextChapterTitle.set_text(array[1] + "<size=25>(" + array[0] + ")</size>");
            }
            ZhuXianPeiZhi zhuXianPeiZhi3 = DataReader <ZhuXianPeiZhi> .Get(di.dungeonId);

            InstancesLayoutItem component;
            if (zhuXianPeiZhi3.bossInstanceBoss == 1)
            {
                GameObject boss = this.GetBoss();
                component = boss.GetComponent <InstancesLayoutItem>();
                boss.get_transform().SetParent(this.InstancesLayout);
                boss.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                boss.set_name(di.dungeonId.ToString());
            }
            else
            {
                GameObject normal = this.GetNormal();
                component = normal.GetComponent <InstancesLayoutItem>();
                normal.get_transform().SetParent(this.InstancesLayout);
                normal.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                normal.set_name(di.dungeonId.ToString());
            }
            component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClcikInstancesLayoutItem);
            this.listInstanceItem.Add(component);
            bool isLock = (bool)DungeonManager.Instance.CheckLock(di.dungeonId).get_Item("ISLock");
            component.RefreshUI(DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId), isLock, k, di.star);
        }
    }