public void Buy(BuildableObject rideOrShop, Wallet fromWallet, ParkInventory toInventory) { if (fromWallet.Balance < rideOrShop.Cost) { throw new ArgumentException("Wallet does not have enough money! Check balance in the UI before calling this method."); } if (toInventory.Contains(rideOrShop)) { throw new ArgumentException("Inventory already contains this item! Check if player owns the item before calling this method."); } rideOrShop.AddToInventory(toInventory); purchasedObjects.Add(rideOrShop); // Always deduct the money fromWallet.SubtractFromBalance(rideOrShop.Cost, "Bought " + rideOrShop.Name); }