Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 public Teletubby(string name, TubbyPhone tubbyPhone)
 {
     _name       = name;
     _tubbyPhone = tubbyPhone;
     tubbyPhone.Attach(this);
 }