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; }
static void Main(string[] args) { Amplifier amf = new Amplifier("Amplifier"); Tuner tun = new Tuner("Tuner",amf); DvdPlayer dvd=new DvdPlayer("DVD",amf); CdPlayer cd =new CdPlayer("CD",amf); Projector projector=new Projector("Projector",dvd); TheaterLights lights=new TheaterLights("TheaterLights"); Screen screen=new Screen("Screen"); PopcornPopper popper=new PopcornPopper("PopcornPopper"); HomeTheaterFacade homeTheatre = new HomeTheaterFacade(amf,tun,dvd,cd, projector, screen,lights, popper); Console.WriteLine(homeTheatre.ListenToRadio(4.5)); Console.WriteLine(homeTheatre.ListenToCd("Bony M")); Console.WriteLine(homeTheatre.EndRadio()); Console.WriteLine(homeTheatre.EndCd()); Console.WriteLine(homeTheatre.WatchMovie("Animate")); Console.WriteLine(homeTheatre.EndMovie()); Console.ReadKey(); }
public string SetCd(CdPlayer cd) { this.cd = cd; return description + " setting CD player to " + cd.Description + "\n"; }