一.外观模式案例
根据类图,实现家庭影院外观模式应用。
实现KTV模式:电视打开,灯关掉,音响打开,麦克风打开,dvd打开;
实现游戏模式:电视打开,音响打开,游戏机打开。
// ConsoleApplication2.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include#include using namespace std; class Television { public: void On() { cout << "打开电视" << endl; } void Off() { cout << "关闭电视" << endl; } }; class Lamp { public: void On() { cout << "打开电灯" << endl; } void Off() { cout << "关闭电灯" << endl; } }; class Audio { public: void On() { cout << "打



