Exemple #1
0
        public override string ToString()
        {
            StringBuilder carDetails = new StringBuilder();

            carDetails.Append(base.ToString()).AppendLine().Append(string.Format("Car number of doors: {0}", VehicleGenerator.SpaceEnumString(this.m_NumberOfDoors.ToString())))
            .AppendLine().Append(string.Format("Car's Color: {0}", VehicleGenerator.SpaceEnumString(this.m_CarColor.ToString()))).AppendLine();

            return(carDetails.ToString());
        }
Exemple #2
0
        public override string ToString()
        {
            StringBuilder motorcycleDetails = new StringBuilder();

            motorcycleDetails.Append(base.ToString()).AppendLine().Append(string.Format("Motorcycle's engine capacity: {0}", this.m_EngineCapacity.ToString()))
            .AppendLine().Append(string.Format("Motorcycle's license type: {0}", VehicleGenerator.SpaceEnumString(this.LicenseType.ToString()))).AppendLine();

            return(motorcycleDetails.ToString());
        }
Exemple #3
0
        /// <summary>
        /// Overriding <see cref="Object.ToString"/>
        /// This function generates a string which consists of the class's member details.
        /// It calls Vehicle.ToString() which returns a string representation of the specific vehicle details and adds it
        /// to vehicle owner number, phone and car garage-status.
        /// </summary>
        /// <returns>a string representation of a vehicle in treatment's full details</returns>
        public override string ToString()
        {
            StringBuilder vehicleInTreatmentDetails = new StringBuilder();

            vehicleInTreatmentDetails.Append(string.Format("Owner name: {0}", m_VehicleOnwerName)).AppendLine()
            .Append(string.Format("Vehicle owner phone number: {0}", m_VehicleOwnerPhoneNumber)).AppendLine()
            .Append(string.Format("Vehicle status: {0}", VehicleGenerator.SpaceEnumString(m_VehicleInTreatmentStatus.ToString()))).AppendLine()
            .Append(m_TheVehicleInTreatment.ToString());

            return(vehicleInTreatmentDetails.ToString());
        }
Exemple #4
0
 public Garage()
 {
     r_ListOfCostumerByLisenceNumber = new Dictionary <string, Customer>();
     m_VehicleGenerator = new VehicleGenerator();
     r_GarageServices   = new Dictionary <int, string>
     {
         { 1, "Add a new vehicle to the garage" },
         { 2, "Display all liscense numbers of the veicles in the garage by given status" },
         { 3, "Update a vehicle status" },
         { 4, "Inflate air to maximum capacity of given vehicle wheels" },
         { 5, "Refuel a Fuel vehicle" },
         { 6, "Recharge an Electric vehicle" },
         { 7, "Display given vehicle information" },
         { 8, "Leave the garage" }
     };
 }
Exemple #5
0
        public Dictionary <string, string> AddVehicle(int i_VehicleType, string i_ModelName, bool i_IsElectric, string i_LicensePlateNumber, string i_OwnerName, string i_OwnerPhoneNumber)
        {
            Vehicle newVehicle = null;
            Dictionary <string, string> specialFeatursDictionary = null;
            Owner vehicleOwner;

            if (ExistsInGarage(i_LicensePlateNumber))
            {
                ChangeState(i_LicensePlateNumber, eState.Fixing);
            }
            else
            {
                vehicleOwner = new Owner(i_OwnerName, i_OwnerPhoneNumber);
                newVehicle   = VehicleGenerator.AddVehicle(i_VehicleType, i_ModelName, i_IsElectric, i_LicensePlateNumber, vehicleOwner);
                this.m_FixingVehiclesInGarage.Add(newVehicle.LicensePlateNumber, newVehicle);
                specialFeatursDictionary = newVehicle.GetSpecialFeatursDictionary();
            }

            return(specialFeatursDictionary);
        }
        public override string ToString()
        {
            StringBuilder electricMotorcycleDetails = new StringBuilder();

            electricMotorcycleDetails.Append(base.ToString()).AppendLine().Append(string.Format("Engine type: {0}", VehicleGenerator.SpaceEnumString(m_EngineType.ToString()))).AppendLine()
            .Append(string.Format("Remaining battery time (in hours): {0}", this.m_Battery.RemainingBatteryTime)).AppendLine()
            .Append(string.Format("Maximum battery charge time: {0}", this.m_Battery.MaximumBatteryTime)).AppendLine();

            return(electricMotorcycleDetails.ToString());
        }
Exemple #7
0
        public override string ToString()
        {
            StringBuilder gasMotorcycleDetails = new StringBuilder();

            gasMotorcycleDetails.Append(base.ToString()).AppendLine().Append(string.Format("Engine type: {0}", VehicleGenerator.SpaceEnumString(m_EngineType.ToString()))).AppendLine()
            .Append(string.Format("Motorcycle's gas type: {0}", this.m_FuelTank.FuelType.ToString())).AppendLine()
            .Append(string.Format("Remaining fuel amount: {0}", this.m_FuelTank.CurrentFuelAmmount)).AppendLine()
            .Append(string.Format("Maximum fuel tank capacity: {0}", this.m_FuelTank.MaximumFuelCapacity)).AppendLine();

            return(gasMotorcycleDetails.ToString());
        }
Exemple #8
0
        public override string ToString()
        {
            StringBuilder truckDetails = new StringBuilder();

            truckDetails.Append(base.ToString()).AppendLine().Append(string.Format("Truck's volume Capacity: {0}", this.m_VolumeCapacity.ToString()))
            .AppendLine().Append(string.Format("Truck contains dangerous cargo: {0}", VehicleGenerator.SpaceEnumString(this.m_TruckCargo.ToString()))).AppendLine()
            .Append(string.Format("Maximum allowed cargo weight: {0}", this.m_MaximumAllowedCargoWeight.ToString())).AppendLine();

            return(truckDetails.ToString());
        }