예제 #1
0
파일: Client.cs 프로젝트: MahendraSv/csdpe
        static void Main()
        {
            IEngine engine = new StandardEngine(1300);
            AbstractDriverControls controls = new StandardControls(engine);
            controls.IgnitionOn();
            controls.Accelerate();

            // Can use a different engine without changing the driver controls
            IEngine turbo = new TurboEngine(1300);
            controls = new SportControls(turbo);
            controls.IgnitionOn();
            controls.Accelerate();

            Console.Read();
        }
예제 #2
0
        static void Main()
        {
            IEngine engine = new StandardEngine(1300);
            AbstractDriverControls controls = new StandardControls(engine);

            controls.IgnitionOn();
            controls.Accelerate();

            // Can use a different engine without changing the driver controls
            IEngine turbo = new TurboEngine(1300);

            controls = new SportControls(turbo);
            controls.IgnitionOn();
            controls.Accelerate();

            Console.Read();
        }