Ejemplo n.º 1
0
        private List <LTHeroBattleListData> InitChallengeList()
        {
            int         count = 0;
            IDictionary dic;

            DataLookupsCache.Instance.SearchDataByID <IDictionary>("userClashOfHeroes.opponent", out dic);
            List <int>            indexs    = new List <int>();
            List <bool>           isFinishs = new List <bool>();
            List <List <string> > enemys    = new List <List <string> >();

            if (dic != null)
            {
                foreach (DictionaryEntry data in dic)
                {
                    indexs.Add(int.Parse((string)data.Key));
                    isFinishs.Add(EB.Dot.Bool("dead", data.Value, false));
                    ArrayList     list      = Hotfix_LT.EBCore.Dot.Array("selectedHeroes", data.Value, null);
                    List <string> herosList = new List <string>();
                    for (var i = 0; i < list.Count; i++)
                    {
                        var value = list[i] as string;
                        herosList.Add(value);
                    }
                    enemys.Add(herosList);
                    count++;
                }
            }
            List <LTHeroBattleListData> datas = new List <LTHeroBattleListData>();

            for (int i = 0; i < 3; i++)
            {
                LTHeroBattleListData temp = new LTHeroBattleListData();
                temp.index     = indexs[i];
                temp.showindex = i + 1;
                temp.state     = isFinishs[i] ? 2 : 1;
                temp.emenyList = enemys[i];
                datas.Add(temp);
            }
            return(datas);
        }
Ejemplo n.º 2
0
        private List <LTHeroBattleListData> GetChangllerList(int type)
        {
            if (type == 2)
            {
                return(InitChallengeList());
            }
            List <LTHeroBattleListData> datas = new List <LTHeroBattleListData>();

            List <HeroBattleTemplate> temp = EventTemplateManager.Instance.GetHeroBattleData();

            for (int i = 0; i < temp.Count; i++)
            {
                if (temp[i].Type == type + 1)
                {
                    LTHeroBattleListData data = new LTHeroBattleListData();
                    data.desc       = temp[i].Desc;
                    data.index      = temp[i].Id;
                    data.showindex  = temp[i].Stage;
                    data.limitLevel = temp[i].Condition;
                    if (LTNewHeroBattleManager.GetInstance().JudgeFinish(temp[i].Id))
                    {
                        data.state = 2;
                    }
                    else if (LTNewHeroBattleManager.GetInstance().JudgeIsLock(temp[i].Id, temp[i].Stage))
                    {
                        data.state = 0;
                    }
                    else
                    {
                        data.state = 1;
                    }
                    data.Name      = temp[i].Name;
                    data.emenyList = temp[i].EnemyHeroConfig;
                    datas.Add(data);
                }
            }

            return(datas);
        }