static void Main(string[] args)
        {
            AfricanLion africanLion = new AfricanLion();
            AsianLion   asianLion   = new AsianLion();

            Hunter hunter = new Hunter();

            hunter.Hunt(africanLion);
            hunter.Hunt(asianLion);

            Wolf        wolf        = new Wolf();
            WolfAdapter wolfAdapter = new WolfAdapter(wolf);

            hunter.Hunt(wolfAdapter);
        }
Пример #2
0
        static void Main(string[] args)
        {
            AfricanLion africanLion = new AfricanLion();
            AsianLion   asianLion   = new AsianLion();

            WildDog        wildDog        = new WildDog();
            WildDogAdapter wildDogAdapter = new WildDogAdapter(wildDog);

            Cat        cat        = new Cat();
            CatAdapter catAdapter = new CatAdapter(cat);

            Hunter hunter = new Hunter();

            hunter.Hunt(asianLion);
            hunter.Hunt(africanLion);
            hunter.Hunt(wildDogAdapter);
            hunter.Hunt(catAdapter);
        }