public int UnloadVehicle(int garageSlot) { ErrorTracker.FullGarage(this.IsFull); ErrorTracker.InvalidGarageSlot(this.GarageSlots, garageSlot); ErrorTracker.EmptyGarageSlot(this.garage[garageSlot]); Vehicle currentVehicle = this.garage[garageSlot]; int uploadedProducts = 0; while (!currentVehicle.IsEmpty && !this.IsFull) { Product currentProduct = currentVehicle.Unload(); this.products.Add(currentProduct); uploadedProducts++; } return(uploadedProducts); }
public Vehicle GetVehicle(int garageSlot) { ErrorTracker.InvalidGarageSlot(this.GarageSlots, garageSlot); ErrorTracker.EmptyGarageSlot(this.garage[garageSlot]); return(this.garage[garageSlot]); }