Exemple #1
0
        static void Main(string[] args)
        {
            VehicleFactory factory = new ConcreteVehicleFactory();

            IFactory scooter = factory.GetVehicle("Scooter");

            scooter.Drive(10);

            IFactory bike = factory.GetVehicle("Bike");

            bike.Drive(20);

            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            VehicleFactory vehicle = new ConcreteVehicleFactory();

            IFactory bike = vehicle.GetVehicle("Bike");

            bike.Drive(12);

            IFactory skateboard = vehicle.GetVehicle("Skateboard");

            skateboard.Drive(7);

            Console.ReadLine();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            VehicleFactory factory = new ConcreteVehicleFactory();

            IFactory Car = factory.GetVehicle("Car");

            Car.Drive(80);

            IFactory bike = factory.GetVehicle("Bike");

            bike.Drive(60);

            Console.ReadKey();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            var factory = new ConcreteVehicleFactory();

            IFactory bike = factory.GetVehicle("bike");

            bike.Drive(50);

            IFactory scooter = factory.GetVehicle("scooter");

            scooter.Drive(25);

            Console.ReadLine();
        }
 static void Main(string[] args)
 {
     VehicleFactory factory = new ConcreteVehicleFactory();
     IFactory scooter = factory.GetVehicle("Scooter");
     scooter.Drive(10);
     IFactory bike = factory.GetVehicle("Bike");
     bike.Drive(20);
     Console.ReadKey();
 }