/// <summary> /// checking out the vehicle /// </summary> /// <param name="licensePlateID">of the vehicle</param> /// <returns>true if check out succeed, else false</returns> public bool CheckOut(string licensePlateID) { if (OccupiedLots.ContainsKey(licensePlateID)) { OccupiedLots[licensePlateID].freeLot(); OccupiedLots.Remove(licensePlateID); return(true); } return(false); }
public Car Pick(string token) { if (!IsCarInLot(token)) { throw new CarNotFoundException("Not found."); } var car = OccupiedLots[token]; OccupiedLots.Remove(token); return(car); }
public string Park(Car car) { if (!HasEmptySpace()) { throw new ParkingFailedException("No space."); } var token = Guid.NewGuid().ToString(); OccupiedLots.Add(token, car); return(token); }
private bool IsCarInLot(string token) { return(OccupiedLots.ContainsKey(token)); }