GameManager.inl
上传用户:royluo
上传日期:2007-01-05
资源大小:1584k
文件大小:2k
源码类别:

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   GameManager.inl
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Contents: Inline functions implementations.
  11. *                                                                             
  12. *   Authors: Eran Yariv - 28484475                                           
  13. *            Moshe Zur  - 24070856                                           
  14. *                                                                            
  15. *                                                                            
  16. *   Date: 23/09/98                                                           
  17. *                                                                            
  18. ******************************************************************************/
  19. inline
  20. CGameManager::~CGameManager()
  21. {
  22.     EndGame();
  23. }
  24. inline void
  25. CGameManager::BeginGame()
  26. {
  27.     StartWorkerThread();
  28. }
  29. inline void
  30. CGameManager::EndGame()
  31. {
  32.     EndWorkerThread(TRUE);
  33. }
  34. inline void 
  35. CGameManager::RemoveObject (CGameObject *pGameObj)
  36. {
  37.     ASSERT (pGameObj);
  38.     m_GameObjsList.RemoveObject(pGameObj);  // will also delete the allocated memory
  39. }
  40. inline void
  41. CGameManager::AddObject (CGameObject *pGameObj)
  42. {
  43.     ASSERT (pGameObj);
  44.     m_GameObjsList.AddObject(pGameObj);
  45. }
  46. inline CGameObjectsList &
  47. CGameManager::ExposeObjects()
  48. {
  49.     return m_GameObjsList;
  50. }
  51. inline UINT 
  52. CGameManager::GetFrequency ()
  53. {
  54.     return m_uFreq;
  55. }
  56. inline void
  57. CGameManager::RefreshDisplay ()
  58. {
  59.     m_bRefreshAll = TRUE;
  60. }
  61. inline BOOL
  62. CGameManager::IsAlive (UINT uTankID)
  63. {
  64.     ASSERT(uTankID < MAX_TANKS);
  65.     return m_pTanks[uTankID] != NULL;
  66. }
  67. inline int
  68. CGameManager::GetLocalTankID() const
  69. {
  70.     return m_iLocalTankID;
  71. }