Пример #1
0
 public HomeTheaterFacade(Amplifier amp,
                          Tuner tuner,
                          DvdPlayer dvd,
                          CDPlayer cd,
                          Projector projector,
                          Screen screen,
                          TheaterLights lights,
                          PopcornPopper popper)
 {
     this.amp       = amp;
     this.tuner     = tuner;
     this.dvd       = dvd;
     this.cd        = cd;
     this.projector = projector;
     this.screen    = screen;
     this.lights    = lights;
     this.popper    = popper;
 }
 public HomeTheaterFacade(Amplifier amp,
                          Tuner tuner,
                          DvdPlayer dvd,
                          CdPlayer cd,
                          Projector projector,
                          TheaterLights lights,
                          Screen screen,
                          PopcornPopper popper)
 {
     _amp       = amp;
     _tuner     = tuner;
     _dvd       = dvd;
     _cd        = cd;
     _projector = projector;
     _lights    = lights;
     _screen    = screen;
     _popper    = popper;
 }
Пример #3
0
        static void Main(string[] args)
        {
            PopcornPopper popper    = new PopcornPopper();
            TheaterLights lights    = new TheaterLights();
            Screen        screen    = new Screen();
            DvdPlayer     dvd       = new DvdPlayer();
            CdPlayer      cd        = new CdPlayer();
            Tuner         tuner     = new Tuner();
            Projector     projector = new Projector(dvd);
            Amplifier     amp       = new Amplifier(tuner, dvd, cd);

            HomeTheaterFacade facade = new HomeTheaterFacade(popper, lights, screen, dvd,
                                                             cd, tuner, projector, amp);

            facade.WatchMovie();
            Console.WriteLine();
            facade.EndMovie();
        }
Пример #4
0
        static void Main(string[] args)
        {
            // Initialize components
            var popper    = new PopcornPopper();
            var lights    = new TheaterLights();
            var screen    = new Screen();
            var projector = new Projector();
            var amp       = new Amplifier();
            var dvd       = new DvdPlayer();

            // Watch "Raiders of the Lost Ark"
            var movieTitle = "Raiders of the Lost Ark";

            Console.WriteLine($"Get ready to watch a movie...");
            popper.On();
            lights.Dim(10);
            screen.Down();
            projector.On();
            projector.WideScreenMode();
            amp.On();
            amp.setDvd(dvd);
            amp.SetSurroundSound();
            amp.SetVolume(5);
            dvd.On();
            dvd.Play(movieTitle);

            // End Movie
            Console.WriteLine("Shutting movie theater down");
            popper.Off();
            lights.On();
            screen.Up();
            projector.Off();
            amp.Off();
            dvd.Stop();
            dvd.Eject();
            dvd.Off();
        }
 public HomeTheaterFacade(Amplifier amp, Tuner tuner, CdPlayer cdPlayer, DvdPlayer dvdPlayer, TheaterLights lights, Screen screen, PopcornPopper popper)
 {
     this.amplifier     = amp;
     this.tuner         = tuner;
     this.cdPlayer      = cdPlayer;
     this.dvdPlayer     = dvdPlayer;
     this.theaterLights = lights;
     this.screen        = screen;
     this.popcornPopper = popper;
 }