static void Main(string[] args) { IHomeCat vaska = new YardCat(); vaska.Name = "Васька"; CatInfoPrinter.PrintCatInfo(vaska); IHomeCat wagner = new PedigreedCat(); wagner.Name = "Вагнер"; CatInfoPrinter.PrintCatInfo(wagner); IWildCat tiger = new Tiger(); HomeCatAdapter adapter = new HomeCatAdapter(tiger); CatInfoPrinter.PrintCatInfo(adapter); ISuperhero elph = new Elph(); SuperheroAdapter superheroAdapteradapter = new SuperheroAdapter(elph); Console.WriteLine("Досье для героя: {0} {1} {2}", superheroAdapteradapter.Fly(), superheroAdapteradapter.Shoot(), superheroAdapteradapter.GoThrougWalls()); Console.ReadLine(); }
static void Main(string[] args) { IHomeCat vaska = new YardCat(); vaska.Name = "Vaska"; CatInfoPrint.PrintCatInfo(vaska); IHomeCat wagner = new PedigreedCat(); wagner.Name = "Wagner"; CatInfoPrint.PrintCatInfo(wagner); IWildCat tiger = new Tiger(); HomeCatAdapter adapter = new HomeCatAdapter(tiger); CatInfoPrint.PrintCatInfo(adapter); Console.ReadLine(); }