DreamWorks

Never say Never。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Design Pattern

摘要:源码在VC++ 6.0通过编译 1 #include "ProxyHeader.h" 2 #include 3 #include 4 5 using namespace std; 6 7 class IPlayer{ 8 public: 9 virtual void Login(string name,string password) = 0;10 virtual void KillBoss() = 0;11 virtual void Upgrade() = 0;12 };13 14 class GamePlayer : public IPlayer15 {16... 阅读全文

posted @ 2013-07-30 00:24 _Babyface 阅读(167) 评论(0) 推荐(0)

摘要:代码在VC++ 6.0通过编译 1 //InitilizeFactory.h 2 #ifndef __INITILIZEFACTORY__ 3 #define __INITILIZEFACTORY__ 4 5 #include 6 using namespace std; 7 8 class Car{ 9 public:10 virtual void info()=0;11 };12 13 14 15 #include 16 17 class Toyota:public Car{18 public:19 virtual void info(){20 cou... 阅读全文

posted @ 2013-07-30 00:22 _Babyface 阅读(219) 评论(0) 推荐(0)

摘要:源代码在VC++ 6.0通过编译 1 //SingletonHeader.h 2 #include 3 #include 4 #include 5 6 class Logger{ 7 public: 8 static const std::string kLogLevelDebug; 9 static const std::string kLogLevelInfo;10 static const std::string kLogLevelError;11 12 static Logger& instance();13 14 //Logs ... 阅读全文

posted @ 2013-07-30 00:20 _Babyface 阅读(179) 评论(0) 推荐(0)