/TGame/TCommon/Scene/SceneB.cpp

http://awoe.googlecode.com/ · C++ · 158 lines · 115 code · 15 blank · 28 comment · 2 complexity · 79a9155e4d6c0d774b91faec9ac1e961 MD5 · raw file

  1. #include "stdafx.h"
  2. #include "SceneB.h"
  3. #include "SceneLua.h"
  4. #include "Lua/LuaWrapper.h"
  5. bool
  6. SceneB::onLoad()
  7. {
  8. SceneLua::push(Lua::instance()->state(), this);
  9. return Lua::instance()->call("Scene", "onLoad", 1, 0);
  10. }
  11. //
  12. // ID
  13. // This is an instance id generate when scene id add into scene manager
  14. //
  15. //
  16. void
  17. SceneB::setID(int nID)
  18. {
  19. m_nID = nID;
  20. }
  21. int
  22. SceneB::getID()const
  23. {
  24. return m_nID;
  25. }
  26. //
  27. // Global ID
  28. // Session ID
  29. //
  30. void
  31. SceneB::setGlobalID(int nID)
  32. {
  33. }
  34. int
  35. SceneB::getGlobalID()const
  36. {
  37. return 0;
  38. }
  39. void
  40. SceneB::setStaticID(int val)
  41. {
  42. m_nStaticID = val;
  43. }
  44. int
  45. SceneB::getStaticID()const
  46. {
  47. return m_nStaticID;
  48. }
  49. //
  50. // Static ID
  51. // ID for static data
  52. //
  53. void
  54. SceneB::setLevel(int v)
  55. {
  56. }
  57. int
  58. SceneB::getLevel()const
  59. {
  60. return 0;
  61. }
  62. //
  63. // Scene Global State
  64. //
  65. void
  66. SceneB::setGState(const short& st)
  67. {
  68. }
  69. short
  70. SceneB::getGState()const
  71. {
  72. return 0;
  73. }
  74. //
  75. // Scene Combat State
  76. //
  77. void
  78. SceneB::setCombatState(const short& st)
  79. {
  80. }
  81. short
  82. SceneB::getCombatState()const
  83. {
  84. return 0;
  85. }
  86. //
  87. // Scene Extension Properties
  88. //
  89. int
  90. SceneB::getProps(const short& nIdx)const
  91. {
  92. PropsMap::const_iterator it = m_theProps.find(nIdx);
  93. if (it==m_theProps.end())
  94. {
  95. return 0;
  96. }
  97. else
  98. {
  99. return it->second;
  100. }
  101. }
  102. void
  103. SceneB::setProps(const short& nIdx, int v)
  104. {
  105. m_theProps[nIdx] = v;
  106. }
  107. //
  108. // Scene Flags
  109. //
  110. void
  111. SceneB::setFlg(const short& nIdx)
  112. {
  113. }
  114. void
  115. SceneB::clrFlg(const short& nIdx)
  116. {
  117. }
  118. bool
  119. SceneB::hasFlg(const short& nIdx)
  120. {
  121. return false;
  122. }
  123. //
  124. // Static Scene Data
  125. //
  126. IDataEx*
  127. SceneB::getStaticSceneData()
  128. {
  129. return NULL;
  130. }
  131. void
  132. SceneB::setStaticSceneData(IDataEx* pSED)
  133. {
  134. }
  135. void
  136. SceneB::forEach(IEntityVisitor& v)
  137. {
  138. IEntityManager* pEttMgr = getEntityMgr();
  139. if (pEttMgr)
  140. {
  141. pEttMgr->forEach(v);
  142. }
  143. }