public CMallItem(CMallFactoryShopController.ShopProduct product, CMallItem.IconType iconType = CMallItem.IconType.Small) { this.m_type = CMallItem.ItemType.Item; this.m_iconType = iconType; if (product != null) { this.m_useable = CUseableManager.CreateUseable(product.Type, 0uL, product.ID, (int)product.LimitCount, 0); this.m_product = product; this.m_firstName = this.m_useable.m_name; this.m_secondName = null; this.m_iconPath = this.m_useable.GetIconPath(); RES_SHOPBUY_COINTYPE coinType = product.CoinType; enPayType payType = CMallSystem.ResBuyTypeToPayType(coinType); uint buyPrice = this.m_useable.GetBuyPrice(coinType); uint payValue = product.ConvertWithRealDiscount(buyPrice); this.m_payInfoSet = new stPayInfoSet(1); this.m_payInfoSet.m_payInfoCount = 1; this.m_payInfoSet.m_payInfos[0].m_discountForDisplay = product.DiscountForShow; this.m_payInfoSet.m_payInfos[0].m_oriValue = buyPrice; this.m_payInfoSet.m_payInfos[0].m_payType = payType; this.m_payInfoSet.m_payInfos[0].m_payValue = payValue; } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_useable = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public CMallItem(uint heroID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Hero; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); if (this.m_heroData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = null; string s_Sprite_Dynamic_Icon_Dir = CUIUtility.s_Sprite_Dynamic_Icon_Dir; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(4, heroID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else if (this.m_heroData.heroCfgInfo != null) { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_heroData.heroCfgInfo.szImagePath; } else { this.m_iconPath = null; } ResHeroPromotion resPromotion = this.m_heroData.promotion(); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_heroData.heroCfgInfo, resPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public CMallItem(uint heroID, uint skinID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Skin; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID); if (this.m_heroData != null && this.m_skinData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = this.m_skinData.szSkinName; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(7, this.m_skinData.dwID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID; } ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }