using System;
public struct Shoe
{
public string Color;
}
public class Dude
{
public string Name;
public Shoe RightShoe;
public Shoe LeftShoe;
/*
public Dude CopyDude()
{
Dude newPerson = new Dude();
newPerson.Name = Name;
newPerson.LeftShoe = LeftShoe;
newPerson.RightShoe = RightShoe;
return newPerson;
}
*/
public override string ToString()
{
return (Name + " : Dude!, I have a "
+ RightShoe.Color + " shoe on my right foot, and a " + LeftShoe.Color + " on my left foot.");
}
}
class x
{
public static void Main()
{
Dude Bill = new Dude();
Bill.Name = "Bill";
Bill.LeftShoe.Color = Bill.RightShoe.Color = "Blue";
//Bill.LeftShoe = new Shoe();
//Bill.RightShoe = new Shoe();
//Dude Ted = Bill.CopyDude();
//OR
Dude Ted = new Dude();
//Bill.CopyDude();
Ted.Name = "Ted";
Ted.LeftShoe.Color = Ted.RightShoe.Color = "Red";
Console.WriteLine(Bill.ToString());
Console.WriteLine(Ted.ToString());
}
}
/*
Bill : Dude!, I have a Blue shoe on my right foot, and a Blue on my left foot.
Ted : Dude!, I have a Red shoe on my right foot, and a Red on my left foot.
*/