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 ); })); }
ObservableList <JRPGOrderLine> CreateOrderLines(Trader trader) { return(trader.Inventory.Convert(item => { return new JRPGOrderLine(item, Prices.GetPrice(item, trader.PriceFactor)); })); }
/// <summary> /// Create OrderLines. /// </summary> /// <param name="items">Items.</param> /// <returns>OrderLines.</returns> static protected ObservableList <JRPGOrderLine> CreateOrderLines(List <Item> items) { return(items.Convert(item => new JRPGOrderLine(item, Prices.GetPrice(item, 1f))).ToObservableList()); }