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

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   MsgQueue.h
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Module description: Implements the message queues used between the game
  11. *                       manager and the communication manager.
  12. *                       
  13. *                                                                             
  14. *   Authors: Eran Yariv - 28484475                                           
  15. *            Moshe Zur  - 24070856                                           
  16. *                                                                            
  17. *                                                                            
  18. *   Date: 23/09/98                                                           
  19. *                                                                            
  20. ******************************************************************************/
  21. #ifndef _MESSAGE_QUEUE_H_
  22. #define _MESSAGE_QUEUE_H_
  23. #include "queue.h"
  24. #include "GameObject.h"
  25. #include "Message.h"
  26. #include "resource.h"
  27. class CMsgQueue : public CQueue
  28. {
  29. public:
  30.     CMsgQueue (BOOL bBlocking = TRUE) : CQueue(bBlocking) {}
  31.     // Enqueue an already allocated message:
  32.     BOOL Enqueue (CMessage *pMsg, BOOL bSorted = FALSE);
  33.     // Alloc new message and insert into Q
  34.     BOOL Enqueue (CMessage::MessageType MsgType, CMessage::MessageData& MsgUnion, GameMessageType = PLAYER_MSG);
  35.     // Get message from Q, copy to pMsg, and delete message:
  36.     BOOL Dequeue (CMessage& pMsg);
  37. };
  38. #include "MsgQueue.inl"
  39. #endif