Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Attempting to drive car without any age check...");

            Car car = new Car();
            car.DriveCar();

            Console.WriteLine("Attempting to drive proxy car as a 16 year old...");

            Driver driver = new Driver(16);

            ProxyCar proxyCar = new ProxyCar(driver);
            proxyCar.DriveCar();

            Console.ReadLine();
        }
Exemplo n.º 2
0
 public ProxyCar(Driver driver)
 {
     _driver = driver;
     _car = new Car();
 }