Esempio n. 1
0
        static void Main(string[] args)
        {
            var e1  = Engine.category.combustion;
            var t1  = new Transmission();
            var col = new Color();
            var car = new Car();

            CarConstructor.Construct(car, col, e1, t1);
            CarConstructor.GetInfo(car);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var car = CarConstructor.Construct(new Transmission(), new Color(), new Engine());

            car.WriteCar();;

            CarConstructor.Reconstruct(car, new Engine("ModelX", 5, 1000));
            car.WriteCar();

            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var car = CarConstructor.Construct(Transmission.AutomaticTransmission, Color.Black, Engine.BMW500);

            car.WriteCar();;

            CarConstructor.Reconstruct(ref car, Engine.Spotr1);
            car.WriteCar();

            Console.ReadLine();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var red    = new Color("red");
            var merlin = new Engine(3000, 744);
            var defaultTransmission = new Transmission();
            var car = new CarConstructor();

            car.Construct(red, merlin, defaultTransmission);
            car.GetInfo();
            var engine2 = new Engine(654, 120);

            car.Reconstruct(engine2);
            car.GetInfo();
        }