Flyweight Pattern1 Flyweight pattern Flyweight pattern 1.소스 #include #include #include #include using namespace std; class Icon { public: Icon(char *fileName) { strcpy(_name, fileName); if (!strcmp(fileName, "go")) { _width = 20; _height = 20; } if (!strcmp(fileName, "stop")) { _width = 40; _height = 40; } if (!strcmp(fileName, "select")) { _width = 60; _height = 60; } if (!strcmp(fileName, "undo")) { _width = 30; _height = 30; } }.. 2016. 7. 18. 이전 1 다음