SceneTree.h
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:

射击游戏

开发平台:

Visual C++

  1. #pragma once
  2. #include "NodeObject.h"
  3. /*
  4.   SceneTree类,储存整个场景中的NodeObject,
  5.   相当于一个二叉树。
  6. */
  7. class SceneTree
  8. {
  9. friend class ShaderController;
  10. friend class FileController;
  11. public:
  12. SceneTree(TCHAR* name);
  13. ~SceneTree();
  14. NodeObject*  AddObject(NodeObject* obj,TCHAR*parentName=NULL,bool copyObj=true);
  15. NodeObject*  AddObject(NodeObject* obj,NodeObject*parent=NULL,bool copyObj=true);
  16. void         AddSubtree(NodeObject* subroot,TCHAR*parentName=NULL,bool copyObj=true);
  17. void         AddSubtree(NodeObject* subroot,NodeObject*parent=NULL,bool copyObj=true);
  18. void         SetParent(TCHAR* name,TCHAR* parentName);
  19. void         SetParent(NodeObject* obj,NodeObject* parent);
  20. void         DeleteObjectWithSubobject(TCHAR* name);
  21. void         DeleteObjectWithSubobject(NodeObject* obj);
  22. void         DeleteObject(TCHAR* name);
  23. void         DeleteObject(NodeObject* name);
  24. NodeObject*  Get(TCHAR* name)const;
  25. NodeObject*  GetRoot()const{return m_pRoot;};
  26. void         GetInType(OBJ_TYPE type,NodeObject *tagObjList,int &objectCount)const;//没有实现
  27.     void         DeleteSubTree(NodeObject* obj);   //New functoin
  28.     void         DeleteSubTree(TCHAR* name);   //New functoin
  29. void         CleanUp();
  30.     
  31. private:
  32. TCHAR*       m_strName;             //场景名
  33. NodeObject*  m_pRoot;                //处于“场景树”最顶部的元素
  34. };