Esempio n. 1
0
 private void InitRewardView(int CurWinCount)
 {
     if (heroBattleRewards == null)
     {
         heroBattleRewards = new List <HeroBattleLevelReward>();
         List <Hotfix_LT.Data.ClashOfHeroesRewardTemplate> tpls = Hotfix_LT.Data.EventTemplateManager.Instance.GetClashOfHeroesRewardTpls();
         for (int i = 0; i < tpls.Count; i++)
         {
             HeroBattleLevelReward reward = new HeroBattleLevelReward();
             reward.id = tpls[i].id;
             LTShowItemData data1 = new LTShowItemData(tpls[i].item_id1, tpls[i].item_num1, tpls[i].item_type1);
             LTShowItemData data2 = new LTShowItemData(tpls[i].item_id2, tpls[i].item_num2, tpls[i].item_type2);
             LTShowItemData data3 = new LTShowItemData(tpls[i].item_id3, tpls[i].item_num3, tpls[i].item_type3);
             LTShowItemData data4 = new LTShowItemData(tpls[i].item_id4, tpls[i].item_num4, tpls[i].item_type4);
             if (!string.IsNullOrEmpty(data1.id))
             {
                 reward.listShowItemData.Add(data1);
             }
             if (!string.IsNullOrEmpty(data2.id))
             {
                 reward.listShowItemData.Add(data2);
             }
             if (!string.IsNullOrEmpty(data3.id))
             {
                 reward.listShowItemData.Add(data3);
             }
             if (!string.IsNullOrEmpty(data4.id))
             {
                 reward.listShowItemData.Add(data4);
             }
             heroBattleRewards.Add(reward);
         }
     }
     awardView.SetData(heroBattleRewards, CurWinCount);
 }
Esempio n. 2
0
        public HeroBattleMatchData()
        {
            listLimitFreeHero = new List <int>();
            listLimitFreeCell = new List <HeroBattleChoiceCellData>();
            listBaseHero      = new List <int>();
            listBaseHeroCell  = new List <HeroBattleChoiceCellData>();

            heroBattleRewards = new List <HeroBattleLevelReward>();
            List <Hotfix_LT.Data.ClashOfHeroesRewardTemplate> tpls = Hotfix_LT.Data.EventTemplateManager.Instance.GetClashOfHeroesRewardTpls();

            for (int i = 0; i < tpls.Count; i++)
            {
                HeroBattleLevelReward reward = new HeroBattleLevelReward();
                reward.id = tpls[i].id;

                LTShowItemData data1 = new LTShowItemData(tpls[i].item_id1, tpls[i].item_num1, tpls[i].item_type1);
                LTShowItemData data2 = new LTShowItemData(tpls[i].item_id2, tpls[i].item_num2, tpls[i].item_type2);
                LTShowItemData data3 = new LTShowItemData(tpls[i].item_id3, tpls[i].item_num3, tpls[i].item_type3);
                LTShowItemData data4 = new LTShowItemData(tpls[i].item_id4, tpls[i].item_num4, tpls[i].item_type4);

                if (!string.IsNullOrEmpty(data1.id))
                {
                    reward.listShowItemData.Add(data1);
                }
                if (!string.IsNullOrEmpty(data2.id))
                {
                    reward.listShowItemData.Add(data2);
                }
                if (!string.IsNullOrEmpty(data3.id))
                {
                    reward.listShowItemData.Add(data3);
                }
                if (!string.IsNullOrEmpty(data4.id))
                {
                    reward.listShowItemData.Add(data4);
                }

                heroBattleRewards.Add(reward);
            }
        }