patterns/facade/hometheater/app.d

22 lines
818 B
D
Raw Normal View History

2022-12-05 07:38:19 +00:00
import amplifier, tuner, streamingplayer, cdplayer, projector, theaterlights, screen, popcornpopper, hometheaterfacade;
void main()
{
auto amp = new Amplifier("Amplifier");
auto tuner = new Tuner("AM/FM Tuner", amp);
auto player = new StreamingPlayer("Streaming Player", amp);
auto cd = new CdPlayer("CD Player", amp);
auto projector = new Projector("Projector", player);
auto lights = new TheaterLights("Theater Ceiling Lights");
auto screen = new Screen("Theater Screen");
auto popper = new PopcornPopper("Popcorn Popper");
auto homeTheater = new HomeTheaterFacade(amp, tuner, player, cd, projector, lights, screen, popper);
homeTheater.watchMovie("Raiders of the Lost Ark");
homeTheater.endMovie();
homeTheater.listenToRadio(101.5);
homeTheater.endRadio();
}