void playMovie() { dvd->on(); projector->on(); amplifier->on(); dvd->play(); }
void watchMovie(std::string movie) { std::cout << "Get ready to watch a movie..." << std::endl; _popper->on(); _popper->pop(); _lights->dim(10); _screen->down(); _projector->on(); _projector->wideScreenMode(); _amp->on(); _amp->setDvd(_dvd); _amp->setSurroundSound(); _amp->setVolume(5); _dvd->on(); _dvd->play(movie); }
void watchMovie( std::string movie ) { HUM_TRACE(ACE_TEXT("HomeTheaterFacade::watchMovie")); std::cout << "Get ready to watch a movie..." << std::endl; _popper->on(); _popper->pop(); _lights->dim( 10 ); _screen->down(); _projector->on(); _projector->wideScreenMode(); _amp->on(); _amp->setDvd( _dvd ); _amp->setSurroundSound(); _amp->setVolume( 5 ); _dvd->on(); _dvd->play( movie ); }
int main() { DVD dvd; Amplifier amplifier; Projector projector; // non-facade method // play movie cout<<"################# Non-facade Pattern ####################"<<endl; dvd.on(); projector.on(); amplifier.on(); dvd.play(); // using facade pattern cout<<"################# Facade Pattern ####################"<<endl; FacadeThreater ft(&dvd, &lifier, &projector); ft.playMovie(); return 0; }