Beispiel #1
0
 public HomeTheaterFacade(Amplifier amp, Tuner tuner, DvdPlayer dvdPlayer, CdPlayer cdPlayer,
                          Projector projector, TheaterLights theaterLights, Screen screen, PopcornPopper popcornPopper)
 {
     _amp           = amp;
     _tuner         = tuner;
     _dvdPlayer     = dvdPlayer;
     _cdPlayer      = cdPlayer;
     _projector     = projector;
     _theaterLights = theaterLights;
     _screen        = screen;
     _popcornPopper = popcornPopper;
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Amplifier         amp               = new Amplifier();
            Tuner             tuner             = new Tuner();
            DvdPlayer         dvdPlayer         = new DvdPlayer();
            CdPlayer          cdPlayer          = new CdPlayer();
            Projector         projector         = new Projector();
            TheaterLights     theaterLights     = new TheaterLights();
            Screen            screen            = new Screen();
            PopcornPopper     popcornPopper     = new PopcornPopper();
            HomeTheaterFacade homeTheaterFacade = new HomeTheaterFacade(amp, tuner, dvdPlayer, cdPlayer, projector, theaterLights, screen, popcornPopper);

            homeTheaterFacade.WatchMovie("复仇者联盟");
            homeTheaterFacade.EndMovie();
        }