Exemplo n.º 1
0
        public void onChangeSortBtnHandler(int index)
        {
            Debugger.Log("index:" + index);
            int          sortIndex = dropDownSort.value;
            HeroSortType type      = (HeroSortType)(sortIndex + 1 + (int)HeroSortType.Invalid);

            if (type != HeroStrengthenProxy.instance.currentSortType)
            {
                HeroStrengthenProxy.instance.currentSortType = type;
                RegenerateHeroButtons();
                RefreshHeroButtons();
            }
        }
Exemplo n.º 2
0
        public List <HeroInfo> GetAllHeroInfoBySortType(HeroSortType type)
        {
            List <HeroInfo> heroInfoList = HeroProxy.instance.GetAllHeroInfoList();

            if (type == HeroSortType.QualityDesc)
            {
                heroInfoList.Sort(HeroUtil.CompareHeroByQualityDesc);
            }
            else if (type == HeroSortType.QualityAsc)
            {
                heroInfoList.Sort(HeroUtil.CompareHeroByQualityAsc);
            }
            allHeroInfoList = heroInfoList;
            return(allHeroInfoList);
        }
Exemplo n.º 3
0
        public List <HeroInfo> GetHeroInfoBySortType(HeroSortType type)
        {
            List <HeroInfo> allInBagHeroInfoList = HeroProxy.instance.GetNotInAnyTeamHeroInfoList();

            for (int index = 0, count = allInBagHeroInfoList.Count; index < count; index++)
            {
                if (allInBagHeroInfoList[index].instanceID == StrengthenHeroInfo.instanceID)
                {
                    allInBagHeroInfoList.RemoveAt(index);
                    break;
                }
            }
            if (type == HeroSortType.QualityAsc)
            {
                allInBagHeroInfoList.Sort(HeroUtil.CompareHeroByQualityAsc);
            }
            else
            {
                allInBagHeroInfoList.Sort(HeroUtil.CompareHeroByQualityDesc);
            }
            currentHeroInfoList = allInBagHeroInfoList;
            return(currentHeroInfoList);
        }