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

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   ManouverSet.h
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Module description: Implements the tanks manouver set (movement and fire
  11. *                       control).
  12. *                       
  13. *                                                                             
  14. *   Authors: Eran Yariv - 28484475                                           
  15. *            Moshe Zur  - 24070856                                           
  16. *                                                                            
  17. *                                                                            
  18. *   Date: 23/09/98                                                           
  19. *                                                                            
  20. ******************************************************************************/
  21. #ifndef MANOUVER_SET_H
  22. #define MANOUVER_SET_H
  23. #include <afxmt.h>
  24. class CManouverSet
  25. {
  26. public:
  27. enum {TURN_RIGHT     ,
  28.       TURN_LEFT      ,
  29.       FORWARD        ,
  30.       BACKWARD       ,
  31.       FIRE_SHELL     ,
  32.       FIRE_BULLET    ,
  33.       DROP_MINE      ,
  34.       AERIAL_SUPPORT ,
  35.       MAX_MANOUVER_BIT };
  36. enum {TURN_RIGHT_MASK     = 1 << TURN_RIGHT,
  37.       TURN_LEFT_MASK      = 1 << TURN_LEFT,
  38.       FORWARD_MASK        = 1 << FORWARD,
  39.       BACKWARD_MASK       = 1 << BACKWARD,
  40.       FIRE_SHELL_MASK     = 1 << FIRE_SHELL,
  41.       FIRE_BULLET_MASK    = 1 << FIRE_BULLET,
  42.       DROP_MINE_MASK      = 1 << DROP_MINE,
  43.       AERIAL_SUPPORT_MASK = 1 << AERIAL_SUPPORT,
  44.       MANOUVER_SET_MASK   = (1 << MAX_MANOUVER_BIT) - 1 };
  45.     CManouverSet ();
  46.     virtual ~CManouverSet ();
  47.     void SetAll (BYTE /* New set */);
  48.     void SetBit (UINT /* Index */);
  49.     void UnsetBit (UINT);
  50.     BYTE GetAll();
  51.     void Clear ();
  52. private:
  53.     BYTE    m_uManouverSet;
  54.     static const UINT MOVE_COLLISION;
  55.     static const UINT TURN_COLLISION;
  56. };
  57. // Inline sections:
  58. #include <ManouverSet.inl>
  59. #endif