Exemple #1
0
        private RewardWrapper GetRewardWrapperByTaskRewardData(RewardItemDataWrap reward)
        {
            RewardWrapper rw = new RewardWrapper();

            rw.m_num = reward.ItemNum;
            rw.m_id  = 0;
            switch (reward.ItemType)
            {
            case RewardItemType.CASH:
                rw.m_icon   = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_CASH);
                rewardCash += rw.m_num;
                break;

            case RewardItemType.COIN:
                rw.m_icon   = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_COIN);
                rewardCoin += rw.m_num;
                break;

            case RewardItemType.EXP:
                rw.m_icon  = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_EXP);
                rewardExp += rw.m_num;
                break;

            case RewardItemType.VIT:
                rw.m_icon  = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_VIT);
                rewardVit += rw.m_num;
                break;

            case RewardItemType.ITEM:
                rw.m_id   = reward.ItemID;
                rw.m_icon = ConfProp.Get(reward.ItemID).icon;
                break;
            }
            return(rw);
        }
Exemple #2
0
        private List <RewardWrapper> GetAcceptTaskDropItem(ConfTask confTask)
        {
            List <RewardWrapper> task_rewards = new List <RewardWrapper>();

            long[] rewardItemIds  = confTask.rewardPropIds;
            int[]  rewardItemNums = confTask.rewardPropNums;

            for (int i = 0; i < rewardItemIds.Length; ++i)
            {
                var reward = ConfProp.Get(rewardItemIds[i]);

                task_rewards.Add(new RewardWrapper()
                {
                    m_icon = reward.icon,
                    m_num  = rewardItemNums[i],
                    m_id   = rewardItemIds[i],
                }
                                 );
            }

            var output = TaskHelper.GetReward(confTask);

            if (output.Item1 > 0)
            {
                RewardWrapper rw = new RewardWrapper()
                {
                    m_id   = 0,
                    m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_VIT),
                    m_num  = output.Item1,
                };
                task_rewards.Add(rw);
            }

            if (output.Item2 > 0)
            {
                RewardWrapper rw = new RewardWrapper()
                {
                    m_id   = 0,
                    m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_COIN),
                    m_num  = output.Item2,
                };
                task_rewards.Add(rw);
            }

            if (output.Item3 > 0)
            {
                RewardWrapper rw = new RewardWrapper()
                {
                    m_id   = 0,
                    m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_CASH),
                    m_num  = output.Item3,
                };
                task_rewards.Add(rw);
            }

            if (output.Item4 > 0)
            {
                RewardWrapper rw = new RewardWrapper()
                {
                    m_id   = 0,
                    m_icon = CommonHelper.GetOutputIconName(EUNM_BASE_REWARD.E_EXP),
                    m_num  = output.Item4,
                };
                task_rewards.Add(rw);
            }
            return(task_rewards);
        }