private ExchangeDetails?ExchangeStock(Stock stock, IStockOwner newOwner) { newOwner.AddStock(stock); stock.Owner.UpdateHoldings(); return(null); }
public Stock(Stock s, double percentage) { Percentage = percentage; s.Percentage -= percentage; company = s.company; Owner = s.Owner; //create new stock from other stock }
public bool BuyStock(Stock stock, IStockOwner buyer) { if (stock == null) { return(false); } if (StocksForSale[Companies.IndexOf(stock.company)].Contains(stock)) { buyer.money -= stock.SellPrice; stock.Owner.money += stock.SellPrice; /*ExchangeDetails? ed = */ ExchangeStock(stock, buyer); return(true); } return(false); }