예제 #1
0
        // Implementation in Homework4
        private static void AdapterPatternDemo()
        {
            IList <IEngine> engines = new List <IEngine>();

            engines.Add(new InboardEngine(450));
            engines.Add(new InboardEngine(600));
            engines.Add(new OutboardEngine(250));
            engines.Add(new OutboardEngine(350));

            UltraEngine ultraEngine = new UltraEngine(1000);

            engines.Add(new UltraEngineAdapter(ultraEngine));

            foreach (IEngine engine in engines)
            {
                Console.WriteLine(engine);
            }
        }
 public UltraEngineAdapter(UltraEngine ultraengine)
     : base(ultraengine.EngineSize, false)
 {
 }