// Sells owned shares of a defunct corporation, returning them to the // corporation's stock func (g *Game) sell(pl interfaces.Player, corp interfaces.Corporation, amount int) { corp.AddStock(amount) pl.RemoveShares(corp, amount). AddCash(corp.StockPrice() * amount) }
func (g *Game) buy(corp interfaces.Corporation, amount int) { corp.RemoveStock(amount) g.CurrentPlayer(). AddShares(corp, amount). RemoveCash(corp.StockPrice() * amount) }