public void DoYourJob(int stepsToWalk) { Console.WriteLine($"{Name} is doing all their {Job} duties..."); Legs.Walk(stepsToWalk); Head.EatPie("Cherry"); Torso.Flex(); Legs.Walk(stepsToWalk); }
public void DoYourJob() { Console.WriteLine($"{Name} is doing all of their {Job} duties..."); Legs.Walk(15); Head.EatPie("Cherry"); Torso.Flex(); Legs.Walk(10); }
//public SpaceGuy(string v1, string v2, ZoeHead head, AstronautTorso torso, AstronautLegs legs) //{ // this.v1 = v1; // this.v2 = v2; // this.head = head; // this.torso = torso; // this.legs = legs; //} public void DoYourJob(int stepsToWalk) { Console.WriteLine($"Here I am. Doing all my {Job} duties... definitely being a very effective {Job}."); Legs.Walk(stepsToWalk); Head.EatPie("Cherry"); Torso.Flex(); Legs.Walk(stepsToWalk); }
public void Battle() { _legs.Walk(); _talker.Talk(); _torso.Flex(); _torso.Fight(); _legs.Kick(); }
public void DoYourJob() { Console.WriteLine($"{Name} is doing all their {Job} duties..."); Legs.Walk(15); Head.EatPie("pumpkin"); Torso.Flex(); // because we are using TorsoBase, can only call common methods from the base. Can't use ChangeThermostat(); Legs.Walk(10); }
static void Main(string[] args) { Console.WriteLine("Let's assemble a Lego character!"); Console.WriteLine('\n'); var head = new Head() { Name = "Mr. Lego" }; Console.WriteLine('\n'); head.Hair = "green"; Console.WriteLine($"Without {head.Name}'s hat, his {head.Hair} hair danced in the wind."); head.MagnifyVision(true); Console.WriteLine('\n'); var torso = new Torso() { }; Console.WriteLine('\n'); Parts.Torso.haveExtraSupplies(true); Console.WriteLine('\n'); var arms = new Arms(); Console.WriteLine('\n'); Console.WriteLine($"{head.Name} asked..."); arms.UseArms("rectangular"); Console.WriteLine('\n'); var legs = new Legs() { }; Console.WriteLine('\n'); Console.WriteLine($"He looked down at his {legs._legColor} legs."); legs.Walk("stubby"); }
public void Walk(int numberOfSteps) { switch (Head.HeadGear) { case Hair hair: Console.WriteLine($"{Name} tossed his {hair.Length} {hair.Color} hair in the wind."); break; case Helmet helmet: Console.WriteLine($"{Name} wondered why he is wearing a {helmet.Color} helmat. He is just going on a walk."); break; } Legs.Walk(numberOfSteps); }
public void Walk(int numberOfSteps) { switch (Head.HeadGear) { case Hair hair: Console.WriteLine($"{Name} tossed his {hair.Length} {hair.Color} hair in the wind."); break; case Helmet helmet: Console.WriteLine($"{Name} wondered why he is wearing a {helmet.Color} helmet."); break; } foreach (var accessory in Torso.Accessories) { } Legs.Walk(numberOfSteps); }