示例#1
0
 // Token: 0x06004E33 RID: 20019 RVA: 0x0017C5E0 File Offset: 0x0017A7E0
 public static BagItemBase PBGoodsToBagItem(BagItemFactory bagItemFactory, ProGoods pbGoods)
 {
     if (BagItemBase.IsInstanceBagItem((GoodsType)pbGoods.GoodsType))
     {
         return(bagItemFactory.CreateInstanceBagItemByClient(pbGoods));
     }
     return(bagItemFactory.CreateBagItem((GoodsType)pbGoods.GoodsType, pbGoods.Id, pbGoods.Nums));
 }
示例#2
0
        // Token: 0x06004E34 RID: 20020 RVA: 0x0017C614 File Offset: 0x0017A814
        public static List <BagItemBase> PBGoodsToBagItems(BagItemFactory bagItemFactory, List <ProGoods> goodsList)
        {
            List <BagItemBase> list = new List <BagItemBase>();

            foreach (ProGoods pbGoods in goodsList)
            {
                list.Add(BagItemBase.PBGoodsToBagItem(bagItemFactory, pbGoods));
            }
            return(list);
        }
示例#3
0
        // Token: 0x06004A68 RID: 19048 RVA: 0x0017422C File Offset: 0x0017242C
        public BagItemBase FindBagItem(GoodsType goodsTypeId, int contentId)
        {
            ulong instanceId = BagItemFactory.CreateBagItemInstanceId(goodsTypeId, contentId);

            return(this.FindBagItem(instanceId));
        }
示例#4
0
        // Token: 0x06004E4A RID: 20042 RVA: 0x0017CA18 File Offset: 0x0017AC18
        public BagItemBase CreateBagItem(GoodsType goodsTypeId, int contentId, int nums)
        {
            ulong instanceId = BagItemFactory.CreateBagItemInstanceId(goodsTypeId, contentId);

            if (goodsTypeId == GoodsType.GoodsType_JobMaterial)
            {
                return(new JobMaterialBagItem(goodsTypeId, contentId, nums, instanceId));
            }
            if (goodsTypeId != GoodsType.GoodsType_Item)
            {
                if (goodsTypeId != GoodsType.GoodsType_EnchantStone)
                {
                    return(null);
                }
                return(new EnchantStoneBagItem(goodsTypeId, contentId, nums, instanceId));
            }
            else
            {
                ConfigDataItemInfo configDataItemInfo = this.ConfigDataLoader.GetConfigDataItemInfo(contentId);
                switch (configDataItemInfo.FuncType)
                {
                case ItemFuncType.ItemFuncType_None:
                case ItemFuncType.ItemFuncType_JobMaterialFragment:
                    return(new UnusableBagItem(goodsTypeId, contentId, nums, instanceId));

                case ItemFuncType.ItemFuncType_Gold:
                    return(new GoldUsableBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        GoldCount = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_Crystal:
                    return(new CrystalUsableBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        CrystalCount = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_Energy:
                    return(new EnergyUsableBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        EnergyCount = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_HeroEXP:
                    return(new HeroExpUseableBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        HeroExp = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_PlayerEXP:
                    return(new PlayerExpUseableBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        PlayerExp = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_HeroFragment:
                    return(new HeroFragmentBagItem(goodsTypeId, contentId, nums, instanceId)
                    {
                        ExchangeMemoryEssence = configDataItemInfo.FuncTypeParam1
                    });

                case ItemFuncType.ItemFuncType_StaticBox:
                    return(new StaticBoxBagItem(goodsTypeId, contentId, nums, instanceId));

                case ItemFuncType.ItemFuncType_RandomBox:
                    return(new RandomBoxBagItem(goodsTypeId, contentId, nums, instanceId));

                case ItemFuncType.ItemFuncType_NameChange:
                    return(new ChangeNameUsableBagItem(goodsTypeId, contentId, nums, instanceId));

                case ItemFuncType.ItemFuncType_AddHeroFavorabilityExp:
                {
                    AddHeroFavorabilityUseableBagItem addHeroFavorabilityUseableBagItem = new AddHeroFavorabilityUseableBagItem(goodsTypeId, contentId, nums, instanceId);
                    addHeroFavorabilityUseableBagItem.NormalAddExp = configDataItemInfo.FuncTypeParam1;
                    addHeroFavorabilityUseableBagItem.SpecificHeroAddFavorabilityExpMultipleValue = configDataItemInfo.FuncTypeParam2;
                    addHeroFavorabilityUseableBagItem.SpecificHeroes.AddRange(configDataItemInfo.FuncTypeParam4);
                    return(addHeroFavorabilityUseableBagItem);
                }

                case ItemFuncType.ItemFuncType_SelfSelectedBox:
                    return(new SelfSelectedBoxBagItem(goodsTypeId, contentId, nums, instanceId));

                default:
                    return(null);
                }
            }
        }