KMissleMagicAttribsData.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. #ifndef __KMISSLEMAGICATTRIBSDATA_H__
  2. #define __KMISSLEMAGICATTRIBSDATA_H__
  3. class KMissleMagicAttribsData
  4. {
  5. int nRef;
  6. public:
  7. KMagicAttrib * m_pStateMagicAttribs;
  8. int m_nStateMagicAttribsNum;
  9. KMagicAttrib * m_pDamageMagicAttribs;
  10. int m_nDamageMagicAttribsNum;
  11. KMagicAttrib * m_pImmediateAttribs;
  12. int m_nImmediateMagicAttribsNum;
  13. /*
  14. #ifdef _DEBUG
  15. static int m_nTotalRef;
  16. static int m_nTotalCount;
  17. #endif
  18. */
  19. private:
  20. void Remove()
  21. {
  22. // if (m_pStateMagicAttribs != NULL) delete m_pStateMagicAttribs; 
  23. if (m_pDamageMagicAttribs != NULL) delete []m_pDamageMagicAttribs; 
  24. };
  25. public:
  26. KMissleMagicAttribsData(){ nRef = m_nStateMagicAttribsNum = m_nDamageMagicAttribsNum = m_nImmediateMagicAttribsNum = 0;
  27. m_pImmediateAttribs = m_pStateMagicAttribs = m_pDamageMagicAttribs = NULL;};
  28. int AddRef(){
  29. /*
  30. #ifdef _DEBUG
  31. ++m_nTotalRef;
  32. ++nRef;
  33. if (nRef == 1)
  34. {
  35. // m_nTotalCount += m_nStateMagicAttribsNum;
  36. m_nTotalCount += m_nDamageMagicAttribsNum;
  37. }
  38. return nRef;
  39. #else
  40.   return ++nRef; 
  41.   #endif
  42. */
  43. return ++ nRef;
  44. };
  45. int GetRef(){ return nRef;};
  46. int DelRef()
  47. {
  48. /*
  49. #ifdef _DEBUG
  50. --m_nTotalRef;
  51. #endif
  52. */
  53. return --nRef; 
  54. };
  55. ~KMissleMagicAttribsData()
  56. {
  57. Remove();
  58. };
  59. };
  60. #endif //__KMISSLEMAGICATTRIBSDATA_H__