public void GetCarDetailsFromUser(out eVehicleColor io_Color, out eDoors io_Doors) { Console.WriteLine("Select Color :"); Console.WriteLine(@"--------------------------- 1. Red. 2. White. 3. Black. 4. Silver. 5. Cancel and return to main menu ----------------------------- Enter your choice : "); io_Color = (eVehicleColor)(getUsersInput(1, 5) % 5); if (io_Color != eVehicleColor.None) { Console.WriteLine("Select number of doors :"); Console.WriteLine(@"--------------------------- 1. 2 doors - Cuppe. 2. 3 doors - TreeDoorCuppe. 3. 4 doors - Sedan. 4. 5 doors - Wagen. 5. Cancel and return to main menu ----------------------------- Enter your choice : "); io_Doors = (eDoors)(getUsersInput(1, 5) % 5); } else { io_Doors = eDoors.None; } }
public Car(string i_Name, string i_Id, float i_EnergyLevel, List <Tier> i_Tiers, Engine i_Engine, eColor i_Color, eDoors i_Doors) : base(i_Name, i_Id, i_Tiers, i_Engine) { m_Color = i_Color; m_Doors = i_Doors; }
public void SetCarAdditionalParams(string i_LicenseNumber, int i_VehicleColor, int i_NumOfDoors) { GarageVehicle garageVehicle = VehiclesInGarage[i_LicenseNumber]; eColors color = checkIfValidColorParam(i_VehicleColor); eDoors numOfDoors = checkIfValidDoorsParam(i_NumOfDoors); if (garageVehicle.Vehicle is FuelCar) { FuelCar fuelCar = garageVehicle.Vehicle as FuelCar; fuelCar.CarDetails.VehicleColor = color; fuelCar.CarDetails.NumOfDoors = numOfDoors; } else if (garageVehicle.Vehicle is ElectricCar) { ElectricCar electricCar = garageVehicle.Vehicle as ElectricCar; electricCar.CarDetails.VehicleColor = color; electricCar.CarDetails.NumOfDoors = numOfDoors; } }
public override void InitializeArguments() { base.InitializeArguments(); Energy.MaxCapacity = m_MaximumEnergyCapacity; m_numOfDoors = (eDoors)Enum.Parse(typeof(eDoors), m_Questioning[(int)eIndexListQuestioningExtras.NumOfDoors].Answer); m_Color = (eColor)Enum.Parse(typeof(eColor), m_Questioning[(int)eIndexListQuestioningExtras.Color].Answer); foreach (Wheel currentWheel in Wheels) { if (float.Parse(m_Questioning[(int)eIndexListQuestioning.WheelMaxAirPressure].Answer) > k_MaximumAirPressure) { throw new ArgumentException("Wheel maximum pressure is bigger than the motorcycle support"); } currentWheel.Initialize(m_Questioning[(int)eIndexListQuestioning.WheelsManufecturer].Answer, float.Parse(m_Questioning[(int)eIndexListQuestioning.WheelMaxAirPressure].Answer), float.Parse(m_Questioning[(int)eIndexListQuestioning.WheelCurrentAirPressure].Answer)); } }
public Car(string i_OwnerName, string i_OwnerPhoneNumber, string i_LPN, string i_Model, eVehicleColor i_Color, eDoors i_Doors) : base(i_LPN, i_OwnerName, i_OwnerPhoneNumber, i_Model) { Color = i_Color; NumberOfDoors = i_Doors; }
public void ReciveNewElectricCar(string i_OwnerName, string i_OwnerPhoneNumber, string i_LPN, string i_Model, float i_CurrentPressure, string i_ManufactureName, float i_AmountOfEnergy, eVehicleColor i_VehicleColor, eDoors i_Doors) { m_VehicleGenerator.AddNewCar(i_CurrentPressure, i_OwnerName, i_OwnerPhoneNumber, i_LPN, i_Model, i_AmountOfEnergy, i_ManufactureName, eEnergyType.Electric, i_VehicleColor, i_Doors); }