static void Main(string[] args) { var head = new NathanHead(); var reptileBody = new ReptilianTorso(); reptileBody.Color = "Brown"; var babyLegs = new BabyLegs(); babyLegs.Length = 19; babyLegs.MainColor = "purple"; babyLegs.ShoeColor = "yellow"; var bestTeacher = new Minifigure("Nathan", head, reptileBody, babyLegs); bestTeacher.Greet(new Person { Name = "Bob" }); var head2 = new MartinHead(); var birdBody = new BirdTorso(); birdBody.Color = "pink"; var manLegs = new Legs.Legs(); manLegs.Length = 10; manLegs.MainColor = "blue"; manLegs.ShoeColor = "brown"; var martin = new Minifigure("Martin", head2, birdBody, manLegs); martin.Greet(bestTeacher); bestTeacher.Karate(martin); martin.TakeABreak(); bestTeacher.TakeABreak(); var pastor = new Pastor() { Name = "Honorable Rev. Eugene Babylegs III" }; var greeters = new List <IGreeter> { pastor, bestTeacher, martin }; foreach (var greeter in greeters) { greeter.Greet(pastor); } Console.ReadLine(); }
static void Main(string[] args) { var head = new NathanHead(); var reptileBody = new ReptilianTorso(); reptileBody.Color = "Brown"; var figure = new Minifigure(head, reptileBody); figure.Greet(); figure.TakeABreak(); Console.ReadLine(); }
static void Main(string[] args) { var head = new NathanHead(); var reptileBody = new ReptilianTorso(); reptileBody.Color = "Brown"; var babylegs = new BabyLegs(); babylegs.length = 19; babylegs.MainColor = "purple"; babylegs.ShoeColor = "yellow"; var nathan = new MiniFigure("Nathan", head, reptileBody, babylegs); nathan.Greet(); var head2 = new MartinHead(); var birdbody = new BirdTorso(); birdbody.Color = "pink"; var manLegs = new Legs.Legs(); manLegs.length = 10; manLegs.MainColor = "blue"; manLegs.ShoeColor = "brown"; var martin = new MiniFigure("Martin", head2, birdbody, manLegs); martin.Greet(); nathan.Karate(martin); martin.TakeABreak(); nathan.TakeABreak(); Console.ReadLine(); }
static void Main(string[] args) { var head = new NathanHead(); var reptileBody = new ReptilianTorso(); var babyLegs = new BabyLegs(); babyLegs.Length = 19; babyLegs.MainColor = "purp"; babyLegs.ShoeColor = "deep satin"; reptileBody.Color = "Brown"; var figure = new Minifigure("Todd", head, reptileBody, babyLegs); figure.Greet(); var head2 = new NathanHead(); var birdBody = new ReptilianTorso(); birdBody.Color = "various"; var manLegs = new BabyLegs(); babyLegs.Length = 36; babyLegs.MainColor = "Gold"; babyLegs.ShoeColor = "Golder"; reptileBody.Color = "Brown"; var figure2 = new Minifigure("Stefan", head, birdBody, manLegs); figure2.Greet(); figure.Karate(figure2); figure.TakeABreak(); figure2.TakeABreak(); Console.ReadLine(); }