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; }
public ShopPrice GetPrice(ItemPeriodType periodType, ushort period) { var price = Prices.FirstOrDefault(p => p.PeriodType == periodType && p.Period == period); if (price == null) { return(Prices.FirstOrDefault(p => p.PeriodType == periodType)); } return(price); }
/// <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 ShopPrice GetPrice(ItemPeriodType periodType, ushort period) { return(Prices.FirstOrDefault(x => x.PeriodType == periodType && x.Period == period)); }