public double OrderItems(IItem item, uint amount) { ISupplier supplierForItem = Marketplace.GetInstance().FindSupplier(item); if (supplierForItem == null) { return(0.0); } if (_stock.ContainsKey(item)) { _stock[item] += amount; } else { _stock.Add(item, amount); } return(supplierForItem.Buy(item, amount)); }
public DefaultSupplier() { this.ItemsWithSupplyPrice = new Dictionary <IItem, double>(); Marketplace.GetInstance().RegisterSupplier(this); }