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

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   CommManager.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 BOOL 
  20. CCommManager::IsConnected()
  21. {
  22.     return m_fIsConnected;
  23. }
  24. inline BOOL 
  25. CCommManager::IsHost()
  26. {
  27.     return m_fIsHost;
  28. }
  29. inline void
  30. CCommManager::EndThread(BOOL bWait)
  31. {
  32.     VERIFY(SetEvent(m_hQuitEvent));
  33.     EndWorkerThread(bWait);
  34. }
  35. inline CCommMessage& 
  36. CCommManager::ExposeMessage()
  37. {
  38.     return m_Message;
  39. }
  40. inline void 
  41. CCommManager::SetHostID()
  42. {
  43.     // Make sure we don't override existing HostID in case of client:
  44.     ASSERT(m_fIsHost || m_idHost == INVALID_PLAYER_ID);
  45.     m_idHost = m_idFrom;
  46. }