예제 #1
0
        static void Main(string[] args)
        {
            TubbyPhone tubbyPhone = new TubbyPhone();
            Teletubby  Lala       = new Teletubby("Lala", tubbyPhone);
            Teletubby  Poo        = new Teletubby("Poo", tubbyPhone);
            Teletubby  Dipsy      = new Teletubby("Dipsy", tubbyPhone);
            Teletubby  TinkyWinky = new Teletubby("Tinky Winky", tubbyPhone);

            tubbyPhone.SayHello();
            tubbyPhone.Play();
            tubbyPhone.TimeForTubbyCustard();
            tubbyPhone.Play();
            tubbyPhone.SayByeBye();

            Console.ReadKey();
        }
예제 #2
0
 public Teletubby(string name, TubbyPhone tubbyPhone)
 {
     _name = name;
     tubbyPhone.Attach(this);
 }