static void Main(string[] args) { Lion lion = new Lion(true, 150); Cat bigCat1 = lion; Console.WriteLine(bigCat1.ToString()); AfricanLion africanLion = new AfricanLion(true, 80, "orange"); Cat bigCat2 = africanLion; Console.WriteLine(bigCat2.Male); }
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); }
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); }