public ShopPrice GetPrice(ItemNumber itemNumber, ItemPriceType priceType, ItemPeriodType periodType, ushort period) { var itemInfo = GetItemInfo(itemNumber, priceType); return(itemInfo?.PriceGroup.GetPrice(periodType, period)); }
public CapsuleRewardDto(CapsuleRewardType _type, uint _pen, ItemNumber _itemnumber, ItemPriceType _priceType, ItemPeriodType _periodType, uint _period) { RewardType = _type; PEN = _pen; ItemNumber = _itemnumber; PriceType = _priceType; PeriodType = _periodType; Period = _period; }
/// <summary> /// Creates a new item /// </summary> /// <exception cref="ArgumentException"></exception> public PlayerItem Create(ItemNumber itemNumber, ItemPriceType priceType, ItemPeriodType periodType, ushort period, byte color, uint effect, uint count) { var shop = GameServer.Instance.ResourceCache.GetShop(); var shopItemInfo = shop.GetItemInfo(itemNumber, priceType); if (shopItemInfo == null) { throw new ArgumentException("Item not found"); } var price = shopItemInfo.PriceGroup.GetPrice(periodType, period); if (price == null) { throw new ArgumentException("Price not found"); } return(Create(shopItemInfo, price, color, effect, count)); }
/// <summary> /// Creates a new item /// </summary> /// <exception cref="ArgumentException"></exception> public PlayerItem Create(ItemNumber itemNumber, ItemPriceType priceType, ItemPeriodType periodType, ushort period, byte color, uint effect, uint count) { // TODO Remove exceptions and instead return a error code var shopItemInfo = _gameDataService.GetShopItemInfo(itemNumber, priceType); if (shopItemInfo == null) { throw new ArgumentException("Item not found"); } var price = shopItemInfo.PriceGroup.GetPrice(periodType, period); if (price == null) { throw new ArgumentException("Price not found"); } return(Create(shopItemInfo, price, color, effect, count)); }
public ShopItemInfo GetItemInfo(ItemNumber itemNumber, ItemPriceType priceType) { var item = GetItem(itemNumber); return(item?.GetItemInfo(priceType)); }
public ShopItemInfo GetItemInfo(ItemPriceType priceType) { return(ItemInfos.FirstOrDefault(x => x.PriceGroup.PriceType == priceType)); }