예제 #1
0
        public static ListView <CUseable> CreateUsableListByRandowReward(RES_RANDOM_REWARD_TYPE type, int cnt, uint baseId)
        {
            ListView <CUseable>  listView = new ListView <CUseable>();
            ResRandomRewardStore dataByKey;

            if (type != RES_RANDOM_REWARD_TYPE.RES_RANDOM_REWARD_TYPE_NEST)
            {
                CUseable cUseable = CUseableManager.CreateUsableByRandowReward(type, cnt, baseId);
                if (cUseable != null)
                {
                    listView.Add(cUseable);
                }
            }
            else if ((dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(baseId)) != null)
            {
                for (int i = 0; i < dataByKey.astRewardDetail.Length; i++)
                {
                    if (dataByKey.astRewardDetail[i].bItemType == 0 || dataByKey.astRewardDetail[i].bItemType >= 18)
                    {
                        break;
                    }
                    listView.AddRange(CUseableManager.CreateUsableListByRandowReward((RES_RANDOM_REWARD_TYPE)dataByKey.astRewardDetail[i].bItemType, (int)dataByKey.astRewardDetail[i].dwLowCnt, dataByKey.astRewardDetail[i].dwItemID));
                }
            }
            return(listView);
        }