Esempio n. 1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="getRewards"></param>
    private void updateGetRewardList(PacketStructChallengeGetReward[] getRewards)
    {
        if (getRewards != null ||
            getRewards.Length == 0)
        {
            IsViewFlag = false;
            rewardList[TAB_REWARD_GET].Clear();

            for (int i = 0; i < getRewards.Length; i++)
            {
                MasterDataChallengeReward master = MasterFinder <MasterDataChallengeReward> .Instance.Find(getRewards[i].fix_id);

                if (master == null)
                {
                    continue;
                }

                ChallengeRewardContext newData = new ChallengeRewardContext();


                newData.SetData(getRewards[i], master);

                rewardList[TAB_REWARD_GET].Add(newData);
            }

            if (rewardList[TAB_REWARD_GET].Count != 0)
            {
                IsViewFlag = true;
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="infoRewards"></param>
    private void updateInfoRewardList(PacketStructChallengeInfoReward[] infoRewards)
    {
        if (infoRewards != null ||
            infoRewards.Length == 0)
        {
            rewardList[TAB_REWARD_LIST].Clear();

            int mode = 0;
            for (int i = 0; i < infoRewards.Length; i++)
            {
                ChallengeRewardContext newData = new ChallengeRewardContext();
                newData.SetData(infoRewards[i]);
                switch (mode)
                {
                case 0:
                {
                    if (infoRewards[i].type < 4)
                    {
                        newData.SetTitleBar(GameTextUtil.GetText("growth_boss_18"));
                        mode = 1;
                    }
                    else
                    {
                        newData.SetTitleBar(GameTextUtil.GetText("growth_boss_19"));
                        mode = 2;
                    }
                }
                break;

                case 1:
                {
                    if (infoRewards[i].type >= 4)
                    {
                        newData.SetTitleBar(GameTextUtil.GetText("growth_boss_19"));
                        mode = 2;
                    }
                }
                break;

                default:
                    break;
                }

                rewardList[TAB_REWARD_LIST].Add(newData);
            }
        }
    }