static ObservableList <HarborOrderLine> CreateOrderLines(Trader harbor, Trader player) { return(harbor.Inventory.Convert(item => { var playerItem = player.Inventory.Find(x => x.Name == item.Name); return new HarborOrderLine( item, Prices.GetPrice(item, harbor.PriceFactor), Prices.GetPrice(item, player.PriceFactor), item.Count, (playerItem == null) ? 0 : playerItem.Count); })); }
/// <summary> /// Create OrderLines. /// </summary> /// <param name="items">Items.</param> /// <returns>OrderLines.</returns> protected static ObservableList <JRPGOrderLine> CreateOrderLines(List <Item> items) { return(items.Convert(item => new JRPGOrderLine(item, Prices.GetPrice(item, 1f))).ToObservableList()); }
static ObservableList <JRPGOrderLine> CreateOrderLines(Trader trader) { return(trader.Inventory.Convert(item => new JRPGOrderLine(item, Prices.GetPrice(item, trader.PriceFactor)))); }