public void Sell(Ore o, int price) { if (Inventory.Contains(o)) { Inventory.Remove(o); Balance += price; } }
public Trend(Ore o, string minPrice, string maxPrice, string[] ts, string[] tb) { this.ore = o; this.minPrice = minPrice; this.maxPrice = maxPrice; this.topSellers = ts; this.topBuyers = tb; }
public void Buy(Ore o, int price) { if (Inventory?.Count >= (int)MaxCapacity) { throw new MaxCapacityReachedException(); } else if (Balance - price < 0) { throw new InsuficientFundsException(); } else { Inventory.Add(o); Balance -= price; } }