CryEngineBase类的设计
2017-06-26 13:42
369 查看
CryEngineBase类,包含了基本的系统指针对象,其对象都是静态对象,则所有派生类均可共享。
struct Cry3DEngineBase { static ISystem* m_pSystem; static IRenderer* m_pRenderer; static ITimer*m_pTimer; static ILog* m_pLog; static IPhysicalWorld*m_pPhysicalWorld; static IConsole* m_pConsole; static C3DEngine* m_p3DEngine; static CVars* m_pCVars; static ICryPak* m_pCryPak; static CObjManager* m_pObjManager; static CTerrain* m_pTerrain; static IParticleManager* m_pPartManager; static std::shared_ptr<pfx2::IParticleSystem> m_pParticleSystem; static IOpticsManager*m_pOpticsManager; static CDecalManager* m_pDecalManager; static CCloudsManager*m_pCloudsManager; static CVisAreaManager* m_pVisAreaManager; static CClipVolumeManager*m_pClipVolumeManager; static CMatMan* m_pMatMan; static CSkyLightManager* m_pSkyLightManager; static CWaterWaveManager* m_pWaterWaveManager; static CRenderMeshMerger* m_pRenderMeshMerger; static CMergedMeshesManager* m_pMergedMeshesManager; static CBreezeGenerator* m_pBreezeGenerator; static IStreamedObjectListener* m_pStreamListener; static CGeomCacheManager* m_pGeomCacheManager; }
这样设计也很精妙,所有子类都可以方便访问系统全局的对象。
class CObjManager : public Cry3DEngineBase; class C3DEngine : public I3DEngine, public Cry3DEngineBase; class CObjManager : public Cry3DEngineBase
相关文章推荐
- SOCKET类的设计和实现
- 营销最顶层设计之一:好客服法则
- 好书整理系列之-设计模式:可复用面向对象软件的基础 8
- 好书整理系列之-设计模式:可复用面向对象软件的基础 9
- 好书整理系列之-设计模式:可复用面向对象软件的基础 7
- 好书整理系列之-设计模式:可复用面向对象软件的基础 6
- 好书整理系列之-设计模式:可复用面向对象软件的基础 5.5
- 好书整理系列之-设计模式:可复用面向对象软件的基础 5
- 好书整理系列之-设计模式:可复用面向对象软件的基础 4
- 好书整理系列之-设计模式:可复用面向对象软件的基础 3
- 好书整理系列之-设计模式:可复用面向对象软件的基础 2
- 好书系列之-设计模式:可复用面向对象软件的基础 1
- 用VC++来设计ActiveX控件
- 算法设计应用实例
- Internet网的嵌入式系统设计
- 与大虾对话: 领悟设计模式
- [导入]Web搜索引擎设计和实现分析
- Linux程式设计入门 - socket/inetd programming
- 关于飞机射击类游戏的设计原理 (加入时间:2001-3-4)
- WDM驱动程序设计之设计开发篇