public void UpdateTerror(HorrorMovies horror) { Console.WriteLine("Notified {0} of {1}'s " + " price change to {2:C} .", _name, horror.GetType().Name, horror.RealPrice); if (horror.RealPrice < _preciosugerido) { Console.WriteLine(_name + " wants to add to cinema " + horror.GetType().Name + "!"); } }
static void Main(string[] args) { ActionMovies action = new ActionMovies(15); HorrorMovies horror = new HorrorMovies(20); action.Attach(new Cinemas("CineCenter", 13.4)); action.Attach(new Cinemas("CineNorte", 13.5)); action.Attach(new Cinemas("CineSur", 13.6)); horror.Attach(new Cinemas("CineCenter", 18.4)); horror.Attach(new Cinemas("CineNorte", 19)); horror.Attach(new Cinemas("CineSur", 17.9)); action.RealPrice = 14.1; action.RealPrice = 14.5; action.RealPrice = 13.9; horror.RealPrice = 19.1; horror.RealPrice = 18.5; horror.RealPrice = 15.1; }