static void Main(string[] args) { Person xc = new Person("小菜"); Console.WriteLine("\n第一种装扮:"); Finery dtx = new TShirts(); Finery kk = new BigTrouser(); Finery pqx = new Sneakers(); dtx.Show(); kk.Show(); pqx.Show(); xc.Show(); Console.WriteLine("\n第二种装扮:"); Finery xz = new Suit(); Finery ld = new Tie(); Finery px = new LeatherShoes(); xz.Show(); ld.Show(); px.Show(); xc.Show(); Console.Read(); }
static void Main(string[] args) { Person p = new Person("小明"); TShirt tShirt = new TShirt(); BigTrouser bigTrouser = new BigTrouser(); Tie tie = new Tie(); LeatherShoes leatherShoes = new LeatherShoes(); tShirt.Decorate(p); tie.Decorate(tShirt); bigTrouser.Decorate(tie); leatherShoes.Decorate(bigTrouser); leatherShoes.Show(); Console.ReadKey(); }