コード例 #1
0
 public Car(string i_ModelName, string i_LicenseNumber, EnrgeyVehicles i_EnrgeyType, float i_RemainingEnergy, string i_ManufacturerName, float i_CurrentAirPressure, ColorCars i_colorCar, DoorNumbers i_DoorNumber)
     : base(i_ModelName, i_LicenseNumber, i_RemainingEnergy)
 {
     m_EnrgeyType = i_EnrgeyType;
     m_colorCar   = i_colorCar;
     m_DoorNumber = i_DoorNumber;
     CreatWheels(4, i_ManufacturerName, i_CurrentAirPressure, 31);
     if (i_EnrgeyType is ElectricVehicles)
     {
         m_EnrgeyType.CreatEnrgey(i_RemainingEnergy, 1.8f);
     }
     else
     {
         m_EnrgeyType.CreatEnrgey(i_RemainingEnergy, 55f);
         ((FuelVehicles)m_EnrgeyType).FuelType = FuelTypes.Octan96;
     }
 }
コード例 #2
0
ファイル: IVehicle.cs プロジェクト: MrCaton/Garage1
        public Vehicles CreateVehicle(string registrationNumber, string modelCar, VehicleTypes vehicleType, ColorCars color, bool isSail, bool isInterCity, bool isCross, int nrMotors)
        {
            Vehicles newVehicle = null;

            switch (vehicleType)
            {
            case VehicleTypes.Car:
                newVehicle = new Car(registrationNumber, modelCar, color, 0);
                break;

            case VehicleTypes.Motorcycle:
                newVehicle = new Motorcycle(registrationNumber, modelCar, 0, isCross);
                break;

            case VehicleTypes.Plane:
                newVehicle = new Plane(registrationNumber, modelCar, color, 0, nrMotors);
                break;

            case VehicleTypes.Boat:
                newVehicle = new Boat(registrationNumber, modelCar, color, 0, isSail);
                break;

            case VehicleTypes.Bus:
                newVehicle = new Bus(registrationNumber, modelCar, color, 0, isInterCity);
                break;
            }
            return(newVehicle);
        }
コード例 #3
0
 public Car(string registrationNumber, string modelCar, ColorCars colorcar, int wheels) : base(registrationNumber, modelCar, wheels)
 {
     Colorcar = colorcar;
 }
コード例 #4
0
ファイル: Car.cs プロジェクト: bsoete/Course_Classes
 public Car(ColorCars colorCar, int actualSpeed)
 {
     this.colorCar    = colorCar;
     this.actualSpeed = actualSpeed;
 }
コード例 #5
0
ファイル: Car.cs プロジェクト: bsoete/Course_Classes
        public int actualSpeed;   // Aanmaken globale variabele van het type int

        #endregion

        #region Constructor(s)
        public Car() // Standaard Parameterloze Constructor
        {
            actualSpeed = 0;
            colorCar    = ColorCars.Groen;
        }
コード例 #6
0
ファイル: Plane.cs プロジェクト: MrCaton/Garage1
 public Plane(string registrationNumber, string modelCar, ColorCars color, int wheels, int nrMotors) : base(registrationNumber, modelCar, wheels)
 {
     NrMotors = nrMotors;
 }
コード例 #7
0
 public Bus(string registrationNumber, string modelCar, ColorCars color, int wheels, bool isInterCity) : base(registrationNumber, modelCar, wheels)
 {
     IsInterCity = isInterCity;
 }
コード例 #8
0
 public Boat(string registrationNumber, string modelCar, ColorCars color, int wheels, bool isSail) : base(registrationNumber, modelCar, wheels)
 {
     IsSail = isSail;
 }