Пример #1
0
 public CarFacade(ICarAccessories accessories, ICarBody body, ICarEngine engine, ICarModel model)
 {
     this.accessories = accessories;
     this.body        = body;
     this.engine      = engine;
     this.model       = model;
 }
Пример #2
0
        public double GetMaxSpeed(IEngine engine, ICarBody body)
        {
            var    rand     = new Random();
            double maxSpeed = rand.Next(100, 450);

            //here the maximum car speed is somehow calculated taking into account the parameters of the body and engine
            return(maxSpeed);
        }
Пример #3
0
        public double GetConsumption(IEngine engine, ICarBody body)
        {
            var    rand        = new Random();
            double consumption = rand.Next(50, 150);

            //here the fuel consumption is somehow calculated taking into account the parameters of the body and engine
            return(consumption);
        }
Пример #4
0
 public Car(IEngine engine, ICarBody body, int carCost, string model, int ID)
 {
     СarBody           = body;
     СarEngine         = engine;
     CarCost           = carCost;
     CarModel          = model;
     CarID             = ID;
     ConsumptionOfFuel = GetConsumption(engine, body);
     MaxSpeed          = GetMaxSpeed(engine, body);
 }
Пример #5
0
 private Car(ICarBody carBody, IEngine engine, IVehicleInterior interior)
 {
     CarBody  = carBody;
     Engine   = engine;
     Interior = interior;
 }
Пример #6
0
 public Car(IEngine engine, ICarBody carbody)
 {
     this.iengine  = engine;
     this.icarbody = carbody;
 }